@volare.finance/nestjs.plugins 2.0.0-alpha.7 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -6
- package/dist/aws/aws.module.d.ts +1 -1
- package/dist/aws/aws.module.js +1 -2
- package/dist/aws/aws.module.js.map +1 -1
- package/dist/aws/aws.service.d.ts +1 -1
- package/dist/aws/aws.service.js +3 -3
- package/dist/aws/aws.service.js.map +1 -1
- package/dist/coingecko/coingecko.module.d.ts +1 -1
- package/dist/coingecko/coingecko.module.js +1 -2
- package/dist/coingecko/coingecko.module.js.map +1 -1
- package/dist/coingecko/coingecko.service.js +3 -3
- package/dist/coingecko/coingecko.service.js.map +1 -1
- package/dist/decorators/api.empty.response.decorator.d.ts +5 -0
- package/dist/decorators/api.empty.response.decorator.js +27 -0
- package/dist/decorators/api.empty.response.decorator.js.map +1 -0
- package/dist/decorators/api.list.response.decorator.d.ts +6 -0
- package/dist/decorators/api.list.response.decorator.js +31 -0
- package/dist/decorators/api.list.response.decorator.js.map +1 -0
- package/dist/decorators/api.obj.response.decorator.d.ts +6 -0
- package/dist/decorators/api.obj.response.decorator.js +28 -0
- package/dist/decorators/api.obj.response.decorator.js.map +1 -0
- package/dist/decorators/index.d.ts +8 -0
- package/dist/decorators/index.js +12 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/decorators/response.dto.d.ts +14 -0
- package/dist/decorators/response.dto.js +31 -0
- package/dist/decorators/response.dto.js.map +1 -0
- package/dist/{binance → exchanges/binance}/binance.config.d.ts +2 -2
- package/dist/exchanges/binance/binance.config.js.map +1 -0
- package/dist/{binance → exchanges/binance}/binance.module.d.ts +2 -2
- package/dist/{binance → exchanges/binance}/binance.module.js +2 -3
- package/dist/exchanges/binance/binance.module.js.map +1 -0
- package/dist/{binance → exchanges/binance}/binance.service.d.ts +6 -3
- package/dist/{binance → exchanges/binance}/binance.service.js +16 -16
- package/dist/exchanges/binance/binance.service.js.map +1 -0
- package/dist/exchanges/binance/index.js.map +1 -0
- package/dist/exchanges/bingx/bingx.config.d.ts +10 -0
- package/dist/exchanges/bingx/bingx.config.js +7 -0
- package/dist/exchanges/bingx/bingx.config.js.map +1 -0
- package/dist/exchanges/bingx/bingx.module.d.ts +9 -0
- package/dist/exchanges/bingx/bingx.module.js +27 -0
- package/dist/exchanges/bingx/bingx.module.js.map +1 -0
- package/dist/exchanges/bingx/bingx.service.d.ts +73 -0
- package/dist/exchanges/bingx/bingx.service.js +68 -0
- package/dist/exchanges/bingx/bingx.service.js.map +1 -0
- package/dist/exchanges/bingx/index.d.ts +7 -0
- package/dist/exchanges/bingx/index.js +11 -0
- package/dist/exchanges/bingx/index.js.map +1 -0
- package/dist/exchanges/bitget/bitget.config.d.ts +10 -0
- package/dist/exchanges/bitget/bitget.config.js +7 -0
- package/dist/exchanges/bitget/bitget.config.js.map +1 -0
- package/dist/exchanges/bitget/bitget.module.d.ts +9 -0
- package/dist/exchanges/bitget/bitget.module.js +27 -0
- package/dist/exchanges/bitget/bitget.module.js.map +1 -0
- package/dist/exchanges/bitget/bitget.service.d.ts +72 -0
- package/dist/exchanges/bitget/bitget.service.js +63 -0
- package/dist/exchanges/bitget/bitget.service.js.map +1 -0
- package/dist/exchanges/bitget/index.d.ts +7 -0
- package/dist/exchanges/bitget/index.js +11 -0
- package/dist/exchanges/bitget/index.js.map +1 -0
- package/dist/exchanges/bybit/bybit.config.d.ts +10 -0
- package/dist/exchanges/bybit/bybit.config.js +7 -0
- package/dist/exchanges/bybit/bybit.config.js.map +1 -0
- package/dist/exchanges/bybit/bybit.module.d.ts +9 -0
- package/dist/exchanges/bybit/bybit.module.js +27 -0
- package/dist/exchanges/bybit/bybit.module.js.map +1 -0
- package/dist/exchanges/bybit/bybit.service.d.ts +103 -0
- package/dist/exchanges/bybit/bybit.service.js +67 -0
- package/dist/exchanges/bybit/bybit.service.js.map +1 -0
- package/dist/exchanges/bybit/index.d.ts +7 -0
- package/dist/exchanges/bybit/index.js +11 -0
- package/dist/exchanges/bybit/index.js.map +1 -0
- package/dist/exchanges/gate.io/gate.io.config.d.ts +10 -0
- package/dist/exchanges/gate.io/gate.io.config.js +7 -0
- package/dist/exchanges/gate.io/gate.io.config.js.map +1 -0
- package/dist/exchanges/gate.io/gate.io.module.d.ts +9 -0
- package/dist/exchanges/gate.io/gate.io.module.js +27 -0
- package/dist/exchanges/gate.io/gate.io.module.js.map +1 -0
- package/dist/exchanges/gate.io/gate.io.service.d.ts +57 -0
- package/dist/exchanges/gate.io/gate.io.service.js +65 -0
- package/dist/exchanges/gate.io/gate.io.service.js.map +1 -0
- package/dist/exchanges/gate.io/index.d.ts +7 -0
- package/dist/exchanges/gate.io/index.js +11 -0
- package/dist/exchanges/gate.io/index.js.map +1 -0
- package/dist/exchanges/index.d.ts +13 -0
- package/dist/exchanges/index.js +17 -0
- package/dist/exchanges/index.js.map +1 -0
- package/dist/exchanges/lbank/index.js.map +1 -0
- package/dist/{lbank → exchanges/lbank}/lbank.config.d.ts +2 -2
- package/dist/exchanges/lbank/lbank.config.js.map +1 -0
- package/dist/{lbank → exchanges/lbank}/lbank.module.d.ts +2 -2
- package/dist/{lbank → exchanges/lbank}/lbank.module.js +2 -3
- package/dist/exchanges/lbank/lbank.module.js.map +1 -0
- package/dist/exchanges/lbank/lbank.service.d.ts +66 -0
- package/dist/exchanges/lbank/lbank.service.js +61 -0
- package/dist/exchanges/lbank/lbank.service.js.map +1 -0
- package/dist/exchanges/mexc/index.js.map +1 -0
- package/dist/{mexc → exchanges/mexc}/mexc.config.d.ts +2 -2
- package/dist/exchanges/mexc/mexc.config.js.map +1 -0
- package/dist/{mexc → exchanges/mexc}/mexc.module.d.ts +2 -2
- package/dist/{mexc → exchanges/mexc}/mexc.module.js +2 -3
- package/dist/exchanges/mexc/mexc.module.js.map +1 -0
- package/dist/{mexc → exchanges/mexc}/mexc.service.d.ts +3 -2
- package/dist/{mexc → exchanges/mexc}/mexc.service.js +12 -13
- package/dist/exchanges/mexc/mexc.service.js.map +1 -0
- package/dist/exchanges/okx/index.d.ts +7 -0
- package/dist/exchanges/okx/index.js +11 -0
- package/dist/exchanges/okx/index.js.map +1 -0
- package/dist/exchanges/okx/okx.config.d.ts +10 -0
- package/dist/exchanges/okx/okx.config.js +7 -0
- package/dist/exchanges/okx/okx.config.js.map +1 -0
- package/dist/exchanges/okx/okx.module.d.ts +9 -0
- package/dist/exchanges/okx/okx.module.js +27 -0
- package/dist/exchanges/okx/okx.module.js.map +1 -0
- package/dist/exchanges/okx/okx.service.d.ts +72 -0
- package/dist/exchanges/okx/okx.service.js +64 -0
- package/dist/exchanges/okx/okx.service.js.map +1 -0
- package/dist/exchanges/venkate/index.d.ts +7 -0
- package/dist/exchanges/venkate/index.js +11 -0
- package/dist/exchanges/venkate/index.js.map +1 -0
- package/dist/exchanges/venkate/venkate.config.d.ts +10 -0
- package/dist/exchanges/venkate/venkate.config.js +7 -0
- package/dist/exchanges/venkate/venkate.config.js.map +1 -0
- package/dist/exchanges/venkate/venkate.module.d.ts +9 -0
- package/dist/exchanges/venkate/venkate.module.js +27 -0
- package/dist/exchanges/venkate/venkate.module.js.map +1 -0
- package/dist/exchanges/venkate/venkate.service.d.ts +56 -0
- package/dist/exchanges/venkate/venkate.service.js +62 -0
- package/dist/exchanges/venkate/venkate.service.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/logger/logger.module.d.ts +1 -1
- package/dist/logger/logger.module.js +1 -2
- package/dist/logger/logger.module.js.map +1 -1
- package/dist/logger/logger.service.d.ts +2 -4
- package/dist/logger/logger.service.js +4 -10
- package/dist/logger/logger.service.js.map +1 -1
- package/dist/middlewares/index.d.ts +5 -0
- package/dist/middlewares/index.js +9 -0
- package/dist/middlewares/index.js.map +1 -0
- package/dist/middlewares/ip.whitelist.middleware.d.ts +9 -0
- package/dist/middlewares/ip.whitelist.middleware.js +25 -0
- package/dist/middlewares/ip.whitelist.middleware.js.map +1 -0
- package/dist/mongo/filter.dto.js.map +1 -1
- package/dist/mongo/mongo.service.d.ts +5 -0
- package/dist/mongo/mongo.service.js +7 -3
- package/dist/mongo/mongo.service.js.map +1 -1
- package/dist/pipes/index.d.ts +0 -1
- package/dist/pipes/index.js +0 -1
- package/dist/pipes/index.js.map +1 -1
- package/dist/pipes/parse-bool.pipe.d.ts +0 -1
- package/dist/pipes/parse-bool.pipe.js +0 -1
- package/dist/pipes/parse-bool.pipe.js.map +1 -1
- package/dist/viabtc/viabtc.module.d.ts +1 -1
- package/dist/viabtc/viabtc.module.js +1 -2
- package/dist/viabtc/viabtc.module.js.map +1 -1
- package/package.json +20 -15
- package/dist/binance/binance.config.js.map +0 -1
- package/dist/binance/binance.module.js.map +0 -1
- package/dist/binance/binance.service.js.map +0 -1
- package/dist/binance/index.js.map +0 -1
- package/dist/lbank/index.js.map +0 -1
- package/dist/lbank/lbank.config.js.map +0 -1
- package/dist/lbank/lbank.module.js.map +0 -1
- package/dist/lbank/lbank.service.d.ts +0 -48
- package/dist/lbank/lbank.service.js +0 -81
- package/dist/lbank/lbank.service.js.map +0 -1
- package/dist/mexc/index.js.map +0 -1
- package/dist/mexc/mexc.config.js.map +0 -1
- package/dist/mexc/mexc.module.js.map +0 -1
- package/dist/mexc/mexc.service.js.map +0 -1
- /package/dist/{binance → exchanges/binance}/binance.config.js +0 -0
- /package/dist/{binance → exchanges/binance}/index.d.ts +0 -0
- /package/dist/{binance → exchanges/binance}/index.js +0 -0
- /package/dist/{lbank → exchanges/lbank}/index.d.ts +0 -0
- /package/dist/{lbank → exchanges/lbank}/index.js +0 -0
- /package/dist/{lbank → exchanges/lbank}/lbank.config.js +0 -0
- /package/dist/{mexc → exchanges/mexc}/index.d.ts +0 -0
- /package/dist/{mexc → exchanges/mexc}/index.js +0 -0
- /package/dist/{mexc → exchanges/mexc}/mexc.config.js +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file bybit.service.ts
|
|
4
|
+
* @date 2024
|
|
5
|
+
* @see https://bybit-exchange.github.io/docs/v5/intro
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.BybitService = void 0;
|
|
9
|
+
const tslib_1 = require("tslib");
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
12
|
+
let BybitService = class BybitService {
|
|
13
|
+
constructor(constant) {
|
|
14
|
+
this.constant = constant;
|
|
15
|
+
if (constant.bybit?.enabled) {
|
|
16
|
+
this.instance = axios_1.default.create({ baseURL: constant.bybit.url });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
checkConstant() {
|
|
20
|
+
if (!this.constant.bybit?.enabled) {
|
|
21
|
+
throw new common_1.HttpException('This feature is not supported', common_1.HttpStatus.BAD_REQUEST);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get Tickers
|
|
26
|
+
* @param category Product type. e.g. linear
|
|
27
|
+
* @param symbol Symbol name e.g. BTCUSDT
|
|
28
|
+
* @param baseCoin Base coin. e.g. BTCUSDT (Apply to option only)
|
|
29
|
+
* @param expDate Expiry date. e.g. 25DEC22 (Apply to option only)
|
|
30
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
31
|
+
*/
|
|
32
|
+
async ticker(category, symbol, baseCoin, expDate) {
|
|
33
|
+
this.checkConstant();
|
|
34
|
+
return (await this.instance.get('/v5/market/tickers', { params: { category, symbol, baseCoin, expDate } })).data;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get Kline
|
|
38
|
+
* @param category Product type. e.g. linear
|
|
39
|
+
* @param symbol Symbol name. e.g. BTCUSDT
|
|
40
|
+
* @param interval Kline interval. e.g. 1d
|
|
41
|
+
* @param start The start timestamp (ms). e.g. 1696089600000
|
|
42
|
+
* @param end The end timestamp (ms). e.g. 1698918180000
|
|
43
|
+
* @param limit Limit for data size per page. e.g. 200
|
|
44
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/kline
|
|
45
|
+
*/
|
|
46
|
+
async klines(symbol, interval, category, start, end, limit) {
|
|
47
|
+
this.checkConstant();
|
|
48
|
+
return (await this.instance.get('/v5/market/kline', { params: { symbol, interval, category, start, end, limit } })).data;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get Orderbook
|
|
52
|
+
* @param category Product type. e.g. linear
|
|
53
|
+
* @param symbol Symbol name. e.g. BTCUSDT
|
|
54
|
+
* @param limit Limit size for each bid and ask. e.g. 25
|
|
55
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/orderbook
|
|
56
|
+
*/
|
|
57
|
+
async depth(category, symbol, limit) {
|
|
58
|
+
this.checkConstant();
|
|
59
|
+
return (await this.instance.get('/v5/market/orderbook', { params: { category, symbol, limit } })).data;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
exports.BybitService = BybitService;
|
|
63
|
+
exports.BybitService = BybitService = tslib_1.__decorate([
|
|
64
|
+
(0, common_1.Injectable)(),
|
|
65
|
+
tslib_1.__param(0, (0, common_1.Inject)('BybitConstant'))
|
|
66
|
+
], BybitService);
|
|
67
|
+
//# sourceMappingURL=bybit.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bybit.service.js","sourceRoot":"","sources":["../../../src/exchanges/bybit/bybit.service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;AAEH,2CAA+E;AAC/E,0DAA6C;AAItC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAGvB,YAAsD,QAAqB;QAArB,aAAQ,GAAR,QAAQ,CAAa;QACzE,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC;YAC5B,IAAI,CAAC,QAAQ,GAAG,eAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC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AC;CACF,CAAA;AArIY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,mBAAU,GAAE;IAIE,mBAAA,IAAA,eAAM,EAAC,eAAe,CAAC,CAAA;GAHzB,YAAY,CAqIxB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file index.ts
|
|
4
|
+
* @date 2024
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
tslib_1.__exportStar(require("./bybit.config"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./bybit.module"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./bybit.service"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exchanges/bybit/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yDAA+B;AAC/B,yDAA+B;AAC/B,0DAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gate.io.config.js","sourceRoot":"","sources":["../../../src/exchanges/gate.io/gate.io.config.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file gate.io.module.ts
|
|
4
|
+
* @date 2024
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.GateIoModule = void 0;
|
|
8
|
+
const config_1 = require("../../config");
|
|
9
|
+
const gate_io_service_1 = require("./gate.io.service");
|
|
10
|
+
class GateIoModule {
|
|
11
|
+
static forRoot(_options) {
|
|
12
|
+
return {
|
|
13
|
+
module: GateIoModule,
|
|
14
|
+
exports: [gate_io_service_1.GateIoService],
|
|
15
|
+
providers: [
|
|
16
|
+
{
|
|
17
|
+
provide: 'GateIoConstant',
|
|
18
|
+
useFactory: (constant) => constant.config(),
|
|
19
|
+
inject: [config_1.ConfigService],
|
|
20
|
+
},
|
|
21
|
+
gate_io_service_1.GateIoService,
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.GateIoModule = GateIoModule;
|
|
27
|
+
//# sourceMappingURL=gate.io.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gate.io.module.js","sourceRoot":"","sources":["../../../src/exchanges/gate.io/gate.io.module.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yCAA4D;AAE5D,uDAAkD;AAElD,MAAa,YAAY;IACvB,MAAM,CAAC,OAAO,CAAC,QAAwB;QACrC,OAAO;YACL,MAAM,EAAE,YAAY;YACpB,OAAO,EAAE,CAAC,+BAAa,CAAC;YACxB,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,gBAAgB;oBACzB,UAAU,EAAE,CAAC,QAAqC,EAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE;oBAC7E,MAAM,EAAE,CAAC,sBAAa,CAAC;iBACxB;gBACD,+BAAa;aACd;SACF,CAAC;IACJ,CAAC;CACF;AAfD,oCAeC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file gate.io.service.ts
|
|
3
|
+
* @date 2024
|
|
4
|
+
* @see https://www.gate.io/docs/developers/apiv4/
|
|
5
|
+
*/
|
|
6
|
+
import { GateIoConfig } from './gate.io.config';
|
|
7
|
+
export declare class GateIoService {
|
|
8
|
+
private readonly constant;
|
|
9
|
+
private readonly instance;
|
|
10
|
+
constructor(constant: GateIoConfig);
|
|
11
|
+
checkConstant(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Retrieve ticker information
|
|
14
|
+
* @param currency_pair Currency pair. e.g. BTC_USDT
|
|
15
|
+
* @param timezone Timezone. e.g. utc0
|
|
16
|
+
* @see https://www.gate.io/docs/developers/apiv4/#retrieve-ticker-information
|
|
17
|
+
*/
|
|
18
|
+
ticker(currency_pair: string, timezone: 'utc0' | 'utc8' | 'all'): Promise<{
|
|
19
|
+
currency_pair: string;
|
|
20
|
+
last: string;
|
|
21
|
+
lowest_ask: string;
|
|
22
|
+
highest_bid: string;
|
|
23
|
+
change_percentage: string;
|
|
24
|
+
base_volume: string;
|
|
25
|
+
quote_volume: string;
|
|
26
|
+
high_24h: string;
|
|
27
|
+
low_24h: string;
|
|
28
|
+
etf_net_value: string;
|
|
29
|
+
etf_pre_net_value: string;
|
|
30
|
+
etf_pre_timestamp: number;
|
|
31
|
+
etf_leverage: string;
|
|
32
|
+
}[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Market candlesticks
|
|
35
|
+
* @param currency_pair Currency pair. e.g. BTC_USDT
|
|
36
|
+
* @param limit Maximum recent data points to return. e.g. 10
|
|
37
|
+
* @param from Start time of candlesticks, formatted in Unix timestamp in seconds. e.g. 1621545600
|
|
38
|
+
* @param to End time of candlesticks, formatted in Unix timestamp in seconds. e.g. 1621545600
|
|
39
|
+
* @param interval Interval time between data points. e.g. 1m
|
|
40
|
+
* @see https://www.gate.io/docs/developers/apiv4/#market-candlesticks
|
|
41
|
+
*/
|
|
42
|
+
klines(currency_pair: string, limit?: string | number, from?: string | number, to?: string | number, interval?: '10s' | '1m' | '5m' | '15m' | '30m' | '1h' | '4h' | '8h' | '1d' | '7d' | '30d'): Promise<[string, string, string, string, string, string, string, string][]>;
|
|
43
|
+
/**
|
|
44
|
+
* Retrieve order book
|
|
45
|
+
* @param currency_pair Currency pair. e.g. BTC_USDT
|
|
46
|
+
* @param interval Order depth. 0 means no aggregation is applied. e.g. 0
|
|
47
|
+
* @param limit Maximum number of order depth data in asks or bids. e.g. 10
|
|
48
|
+
* @param with_id Return order book ID. e.g. false
|
|
49
|
+
* @see https://www.gate.io/docs/developers/apiv4/#retrieve-order-book
|
|
50
|
+
*/
|
|
51
|
+
depth(currency_pair: string, interval?: string, limit?: string | number, with_id?: boolean): Promise<{
|
|
52
|
+
current: number;
|
|
53
|
+
update: number;
|
|
54
|
+
asks: [string, string][];
|
|
55
|
+
bids: [string, string][];
|
|
56
|
+
}>;
|
|
57
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file gate.io.service.ts
|
|
4
|
+
* @date 2024
|
|
5
|
+
* @see https://www.gate.io/docs/developers/apiv4/
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.GateIoService = void 0;
|
|
9
|
+
const tslib_1 = require("tslib");
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
12
|
+
let GateIoService = class GateIoService {
|
|
13
|
+
constructor(constant) {
|
|
14
|
+
this.constant = constant;
|
|
15
|
+
if (constant['gate.io']?.enabled) {
|
|
16
|
+
this.instance = axios_1.default.create({ baseURL: constant['gate.io'].url });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
checkConstant() {
|
|
20
|
+
if (!this.constant['gate.io']?.enabled) {
|
|
21
|
+
throw new common_1.HttpException('This feature is not supported', common_1.HttpStatus.BAD_REQUEST);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Retrieve ticker information
|
|
26
|
+
* @param currency_pair Currency pair. e.g. BTC_USDT
|
|
27
|
+
* @param timezone Timezone. e.g. utc0
|
|
28
|
+
* @see https://www.gate.io/docs/developers/apiv4/#retrieve-ticker-information
|
|
29
|
+
*/
|
|
30
|
+
async ticker(currency_pair, timezone) {
|
|
31
|
+
this.checkConstant();
|
|
32
|
+
return (await this.instance.get('/spot/tickers', { params: { currency_pair, timezone } })).data;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Market candlesticks
|
|
36
|
+
* @param currency_pair Currency pair. e.g. BTC_USDT
|
|
37
|
+
* @param limit Maximum recent data points to return. e.g. 10
|
|
38
|
+
* @param from Start time of candlesticks, formatted in Unix timestamp in seconds. e.g. 1621545600
|
|
39
|
+
* @param to End time of candlesticks, formatted in Unix timestamp in seconds. e.g. 1621545600
|
|
40
|
+
* @param interval Interval time between data points. e.g. 1m
|
|
41
|
+
* @see https://www.gate.io/docs/developers/apiv4/#market-candlesticks
|
|
42
|
+
*/
|
|
43
|
+
async klines(currency_pair, limit, from, to, interval) {
|
|
44
|
+
this.checkConstant();
|
|
45
|
+
return (await this.instance.get('/spot/candlesticks', { params: { currency_pair, limit, from, to, interval } })).data;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Retrieve order book
|
|
49
|
+
* @param currency_pair Currency pair. e.g. BTC_USDT
|
|
50
|
+
* @param interval Order depth. 0 means no aggregation is applied. e.g. 0
|
|
51
|
+
* @param limit Maximum number of order depth data in asks or bids. e.g. 10
|
|
52
|
+
* @param with_id Return order book ID. e.g. false
|
|
53
|
+
* @see https://www.gate.io/docs/developers/apiv4/#retrieve-order-book
|
|
54
|
+
*/
|
|
55
|
+
async depth(currency_pair, interval, limit, with_id) {
|
|
56
|
+
this.checkConstant();
|
|
57
|
+
return (await this.instance.get('/spot/order_book', { params: { currency_pair, interval, limit, with_id } })).data;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
exports.GateIoService = GateIoService;
|
|
61
|
+
exports.GateIoService = GateIoService = tslib_1.__decorate([
|
|
62
|
+
(0, common_1.Injectable)(),
|
|
63
|
+
tslib_1.__param(0, (0, common_1.Inject)('GateIoConstant'))
|
|
64
|
+
], GateIoService);
|
|
65
|
+
//# sourceMappingURL=gate.io.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gate.io.service.js","sourceRoot":"","sources":["../../../src/exchanges/gate.io/gate.io.service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;AAEH,2CAA+E;AAC/E,0DAA6C;AAItC,IAAM,a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,CAAC;QACrB,OAAO,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACrH,CAAC;CACF,CAAA;AAvFY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAIE,mBAAA,IAAA,eAAM,EAAC,gBAAgB,CAAC,CAAA;GAH1B,aAAa,CAuFzB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file index.ts
|
|
4
|
+
* @date 2024
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
tslib_1.__exportStar(require("./gate.io.config"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./gate.io.module"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./gate.io.service"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exchanges/gate.io/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAiC;AACjC,2DAAiC;AACjC,4DAAkC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file index.ts
|
|
3
|
+
* @date 2024
|
|
4
|
+
*/
|
|
5
|
+
export * from './binance';
|
|
6
|
+
export * from './bingx';
|
|
7
|
+
export * from './bitget';
|
|
8
|
+
export * from './bybit';
|
|
9
|
+
export * from './gate.io';
|
|
10
|
+
export * from './lbank';
|
|
11
|
+
export * from './mexc';
|
|
12
|
+
export * from './okx';
|
|
13
|
+
export * from './venkate';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file index.ts
|
|
4
|
+
* @date 2024
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
tslib_1.__exportStar(require("./binance"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./bingx"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./bitget"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./bybit"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./gate.io"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./lbank"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./mexc"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./okx"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./venkate"), exports);
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/exchanges/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,oDAA0B;AAC1B,kDAAwB;AACxB,mDAAyB;AACzB,kDAAwB;AACxB,oDAA0B;AAC1B,kDAAwB;AACxB,iDAAuB;AACvB,gDAAsB;AACtB,oDAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exchanges/lbank/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yDAA+B;AAC/B,yDAA+B;AAC/B,0DAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lbank.config.js","sourceRoot":"","sources":["../../../src/exchanges/lbank/lbank.config.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @date 2023
|
|
4
4
|
*/
|
|
5
5
|
import { DynamicModule } from '@nestjs/common';
|
|
6
|
-
import { ConfigOptions } from '
|
|
6
|
+
import { ConfigOptions } from '../../config';
|
|
7
7
|
export declare class LBankModule {
|
|
8
|
-
static forRoot(
|
|
8
|
+
static forRoot(_options?: ConfigOptions): DynamicModule;
|
|
9
9
|
}
|
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.LBankModule = void 0;
|
|
8
|
-
const config_1 = require("
|
|
8
|
+
const config_1 = require("../../config");
|
|
9
9
|
const lbank_service_1 = require("./lbank.service");
|
|
10
10
|
class LBankModule {
|
|
11
|
-
static forRoot(
|
|
11
|
+
static forRoot(_options) {
|
|
12
12
|
return {
|
|
13
13
|
module: LBankModule,
|
|
14
|
-
imports: [config_1.ConfigModule.forRoot(options)],
|
|
15
14
|
exports: [lbank_service_1.LBankService],
|
|
16
15
|
providers: [
|
|
17
16
|
{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lbank.module.js","sourceRoot":"","sources":["../../../src/exchanges/lbank/lbank.module.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yCAA4D;AAE5D,mDAA+C;AAE/C,MAAa,WAAW;IACtB,MAAM,CAAC,OAAO,CAAC,QAAwB;QACrC,OAAO;YACL,MAAM,EAAE,WAAW;YACnB,OAAO,EAAE,CAAC,4BAAY,CAAC;YACvB,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,eAAe;oBACxB,UAAU,EAAE,CAAC,QAAoC,EAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE;oBAC5E,MAAM,EAAE,CAAC,sBAAa,CAAC;iBACxB;gBACD,4BAAY;aACb;SACF,CAAC;IACJ,CAAC;CACF;AAfD,kCAeC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file lbank.service.ts
|
|
3
|
+
* @date 2023
|
|
4
|
+
* @see https://www.lbank.com/en-US/docs/index.html
|
|
5
|
+
*/
|
|
6
|
+
import { LBankConfig } from './lbank.config';
|
|
7
|
+
export declare class LBankService {
|
|
8
|
+
private readonly constant;
|
|
9
|
+
private readonly instance;
|
|
10
|
+
constructor(constant: LBankConfig);
|
|
11
|
+
checkConstant(): void;
|
|
12
|
+
/**
|
|
13
|
+
* 24hr Ticker
|
|
14
|
+
* @param symbol Pair. e.g. btc_usdt
|
|
15
|
+
* @see https://www.lbank.com/en-US/docs/index.html#24hr-ticker
|
|
16
|
+
*/
|
|
17
|
+
ticker(symbol: string): Promise<{
|
|
18
|
+
msg: string;
|
|
19
|
+
result: string;
|
|
20
|
+
data: {
|
|
21
|
+
symbol: string;
|
|
22
|
+
ticker: {
|
|
23
|
+
high: string;
|
|
24
|
+
vol: string;
|
|
25
|
+
low: string;
|
|
26
|
+
change: string;
|
|
27
|
+
turnover: string;
|
|
28
|
+
latest: string;
|
|
29
|
+
};
|
|
30
|
+
timestamp: number;
|
|
31
|
+
}[];
|
|
32
|
+
error_code: number;
|
|
33
|
+
ts: number;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Query K Bar Data
|
|
37
|
+
* @param symbol Trading Pair. e.g. btc_usdt
|
|
38
|
+
* @param type e.g. hour1
|
|
39
|
+
* @param time Timestamp (of Seconds). e.g. 1696089600
|
|
40
|
+
* @param size Count of the bars. e.g. 500
|
|
41
|
+
* @see https://www.lbank.com/en-US/docs/index.html#query-k-bar-data
|
|
42
|
+
*/
|
|
43
|
+
klines(symbol: string, type: 'minute1' | 'minute5' | 'minute15' | 'minute30' | 'hour1' | 'hour4' | 'hour8' | 'hour12' | 'day1' | 'week1' | 'month1', time: string | number, size: string | number): Promise<{
|
|
44
|
+
msg: string;
|
|
45
|
+
result: string;
|
|
46
|
+
data: [number, number, number, number, number, number][];
|
|
47
|
+
error_code: number;
|
|
48
|
+
ts: number;
|
|
49
|
+
}>;
|
|
50
|
+
/**
|
|
51
|
+
* Depth information
|
|
52
|
+
* @param symbol Trading Pair. e.g. btc_usdt
|
|
53
|
+
* @param size The count of returned items. e.g. 200
|
|
54
|
+
* @see https://www.lbank.com/en-US/docs/index.html#depth-information
|
|
55
|
+
*/
|
|
56
|
+
depth(symbol: string, size: string | number): Promise<{
|
|
57
|
+
result: string;
|
|
58
|
+
data: {
|
|
59
|
+
asks: [string, string][];
|
|
60
|
+
bids: [string, string][];
|
|
61
|
+
timestamp: number;
|
|
62
|
+
};
|
|
63
|
+
error_code: number;
|
|
64
|
+
ts: number;
|
|
65
|
+
}>;
|
|
66
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file lbank.service.ts
|
|
4
|
+
* @date 2023
|
|
5
|
+
* @see https://www.lbank.com/en-US/docs/index.html
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.LBankService = void 0;
|
|
9
|
+
const tslib_1 = require("tslib");
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
12
|
+
let LBankService = class LBankService {
|
|
13
|
+
constructor(constant) {
|
|
14
|
+
this.constant = constant;
|
|
15
|
+
if (constant.lbank?.enabled) {
|
|
16
|
+
this.instance = axios_1.default.create({ baseURL: constant.lbank.url });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
checkConstant() {
|
|
20
|
+
if (!this.constant.lbank?.enabled) {
|
|
21
|
+
throw new common_1.HttpException('This feature is not supported', common_1.HttpStatus.BAD_REQUEST);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 24hr Ticker
|
|
26
|
+
* @param symbol Pair. e.g. btc_usdt
|
|
27
|
+
* @see https://www.lbank.com/en-US/docs/index.html#24hr-ticker
|
|
28
|
+
*/
|
|
29
|
+
async ticker(symbol) {
|
|
30
|
+
this.checkConstant();
|
|
31
|
+
return (await this.instance.get('/v2/ticker/24hr.do', { params: { symbol } })).data;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Query K Bar Data
|
|
35
|
+
* @param symbol Trading Pair. e.g. btc_usdt
|
|
36
|
+
* @param type e.g. hour1
|
|
37
|
+
* @param time Timestamp (of Seconds). e.g. 1696089600
|
|
38
|
+
* @param size Count of the bars. e.g. 500
|
|
39
|
+
* @see https://www.lbank.com/en-US/docs/index.html#query-k-bar-data
|
|
40
|
+
*/
|
|
41
|
+
async klines(symbol, type, time, size) {
|
|
42
|
+
this.checkConstant();
|
|
43
|
+
return (await this.instance.get('/v2/kline.do', { params: { symbol, type, time, size } })).data;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Depth information
|
|
47
|
+
* @param symbol Trading Pair. e.g. btc_usdt
|
|
48
|
+
* @param size The count of returned items. e.g. 200
|
|
49
|
+
* @see https://www.lbank.com/en-US/docs/index.html#depth-information
|
|
50
|
+
*/
|
|
51
|
+
async depth(symbol, size) {
|
|
52
|
+
this.checkConstant();
|
|
53
|
+
return (await this.instance.get('/v2/depth.do', { params: { symbol, size } })).data;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.LBankService = LBankService;
|
|
57
|
+
exports.LBankService = LBankService = tslib_1.__decorate([
|
|
58
|
+
(0, common_1.Injectable)(),
|
|
59
|
+
tslib_1.__param(0, (0, common_1.Inject)('LBankConstant'))
|
|
60
|
+
], LBankService);
|
|
61
|
+
//# sourceMappingURL=lbank.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lbank.service.js","sourceRoot":"","sources":["../../../src/exchanges/lbank/lbank.service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;AAEH,2CAA+E;AAC/E,0DAA6C;AAItC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAGvB,YAAsD,QAAqB;QAArB,aAAQ,GAAR,QAAQ,CAAa;QACzE,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC;YAC5B,IAAI,CAAC,QAAQ,GAAG,eAAK,C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AC,CAAA;GAHzB,YAAY,CA6ExB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exchanges/mexc/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,wDAA8B;AAC9B,wDAA8B;AAC9B,yDAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mexc.config.js","sourceRoot":"","sources":["../../../src/exchanges/mexc/mexc.config.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @date 2023
|
|
4
4
|
*/
|
|
5
5
|
import { DynamicModule } from '@nestjs/common';
|
|
6
|
-
import { ConfigOptions } from '
|
|
6
|
+
import { ConfigOptions } from '../../config';
|
|
7
7
|
export declare class MexcModule {
|
|
8
|
-
static forRoot(
|
|
8
|
+
static forRoot(_options?: ConfigOptions): DynamicModule;
|
|
9
9
|
}
|
|
@@ -5,13 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.MexcModule = void 0;
|
|
8
|
-
const config_1 = require("
|
|
8
|
+
const config_1 = require("../../config");
|
|
9
9
|
const mexc_service_1 = require("./mexc.service");
|
|
10
10
|
class MexcModule {
|
|
11
|
-
static forRoot(
|
|
11
|
+
static forRoot(_options) {
|
|
12
12
|
return {
|
|
13
13
|
module: MexcModule,
|
|
14
|
-
imports: [config_1.ConfigModule.forRoot(options)],
|
|
15
14
|
exports: [mexc_service_1.MexcService],
|
|
16
15
|
providers: [
|
|
17
16
|
{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mexc.module.js","sourceRoot":"","sources":["../../../src/exchanges/mexc/mexc.module.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yCAA4D;AAE5D,iDAA6C;AAE7C,MAAa,UAAU;IACrB,MAAM,CAAC,OAAO,CAAC,QAAwB;QACrC,OAAO;YACL,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,CAAC,0BAAW,CAAC;YACtB,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,cAAc;oBACvB,UAAU,EAAE,CAAC,QAAmC,EAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE;oBAC3E,MAAM,EAAE,CAAC,sBAAa,CAAC;iBACxB;gBACD,0BAAW;aACZ;SACF,CAAC;IACJ,CAAC;CACF;AAfD,gCAeC"}
|
|
@@ -8,6 +8,7 @@ export declare class MexcService {
|
|
|
8
8
|
private readonly constant;
|
|
9
9
|
private readonly instance;
|
|
10
10
|
constructor(constant: MexcConfig);
|
|
11
|
+
checkConstant(): void;
|
|
11
12
|
/**
|
|
12
13
|
* Market Data - Current Average Price
|
|
13
14
|
* @param symbol e.g. BTCUSDT
|
|
@@ -50,14 +51,14 @@ export declare class MexcService {
|
|
|
50
51
|
* @param limit e.g. 500
|
|
51
52
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#kline-candlestick-data
|
|
52
53
|
*/
|
|
53
|
-
klines(symbol: string, interval: '1m' | '5m' | '15m' | '30m' | '60m' | '4h' | '1d' | '1M', startTime?: string | number, endTime?: string | number, limit?: number): Promise<[number, string, string, string, string, string, number, string][]>;
|
|
54
|
+
klines(symbol: string, interval: '1m' | '5m' | '15m' | '30m' | '60m' | '4h' | '1d' | '1w' | '1M', startTime?: string | number, endTime?: string | number, limit?: string | number): Promise<[number, string, string, string, string, string, number, string][]>;
|
|
54
55
|
/**
|
|
55
56
|
* Market Data - Order Book
|
|
56
57
|
* @param symbol e.g. BTCUSDT
|
|
57
58
|
* @param limit e.g. 500
|
|
58
59
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#order-book
|
|
59
60
|
*/
|
|
60
|
-
depth(symbol: string, limit?: number): Promise<{
|
|
61
|
+
depth(symbol: string, limit?: string | number): Promise<{
|
|
61
62
|
lastUpdateId: number;
|
|
62
63
|
bids: [string, string][];
|
|
63
64
|
asks: [string, string][];
|