@volare.finance/nestjs.plugins 1.1.3 → 1.1.7

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.
Files changed (127) hide show
  1. package/README.md +81 -1
  2. package/dist/aws/aws.module.d.ts +1 -1
  3. package/dist/aws/aws.module.js +1 -2
  4. package/dist/aws/aws.module.js.map +1 -1
  5. package/dist/coingecko/coingecko.module.d.ts +1 -1
  6. package/dist/coingecko/coingecko.module.js +1 -2
  7. package/dist/coingecko/coingecko.module.js.map +1 -1
  8. package/dist/coingecko/coingecko.service.js +3 -3
  9. package/dist/coingecko/coingecko.service.js.map +1 -1
  10. package/dist/decorators/api.list.response.decorator.d.ts +6 -0
  11. package/dist/decorators/api.list.response.decorator.js +32 -0
  12. package/dist/decorators/api.list.response.decorator.js.map +1 -0
  13. package/dist/decorators/api.obj.response.decorator.d.ts +6 -0
  14. package/dist/decorators/api.obj.response.decorator.js +29 -0
  15. package/dist/decorators/api.obj.response.decorator.js.map +1 -0
  16. package/dist/decorators/index.d.ts +7 -0
  17. package/dist/decorators/index.js +11 -0
  18. package/dist/decorators/index.js.map +1 -0
  19. package/dist/decorators/response.dto.d.ts +15 -0
  20. package/dist/decorators/response.dto.js +34 -0
  21. package/dist/decorators/response.dto.js.map +1 -0
  22. package/dist/exchanges/binance/binance.config.d.ts +2 -2
  23. package/dist/exchanges/binance/binance.module.d.ts +1 -1
  24. package/dist/exchanges/binance/binance.module.js +1 -2
  25. package/dist/exchanges/binance/binance.module.js.map +1 -1
  26. package/dist/exchanges/binance/binance.service.d.ts +6 -3
  27. package/dist/exchanges/binance/binance.service.js +16 -16
  28. package/dist/exchanges/binance/binance.service.js.map +1 -1
  29. package/dist/exchanges/bingx/bingx.config.d.ts +10 -0
  30. package/dist/exchanges/bingx/bingx.config.js +7 -0
  31. package/dist/exchanges/bingx/bingx.config.js.map +1 -0
  32. package/dist/exchanges/bingx/bingx.module.d.ts +9 -0
  33. package/dist/exchanges/bingx/bingx.module.js +27 -0
  34. package/dist/exchanges/bingx/bingx.module.js.map +1 -0
  35. package/dist/exchanges/bingx/bingx.service.d.ts +73 -0
  36. package/dist/exchanges/bingx/bingx.service.js +68 -0
  37. package/dist/exchanges/bingx/bingx.service.js.map +1 -0
  38. package/dist/exchanges/bingx/index.d.ts +7 -0
  39. package/dist/exchanges/bingx/index.js +11 -0
  40. package/dist/exchanges/bingx/index.js.map +1 -0
  41. package/dist/exchanges/bitget/bitget.config.d.ts +10 -0
  42. package/dist/exchanges/bitget/bitget.config.js +7 -0
  43. package/dist/exchanges/bitget/bitget.config.js.map +1 -0
  44. package/dist/exchanges/bitget/bitget.module.d.ts +9 -0
  45. package/dist/exchanges/bitget/bitget.module.js +27 -0
  46. package/dist/exchanges/bitget/bitget.module.js.map +1 -0
  47. package/dist/exchanges/bitget/bitget.service.d.ts +72 -0
  48. package/dist/exchanges/bitget/bitget.service.js +63 -0
  49. package/dist/exchanges/bitget/bitget.service.js.map +1 -0
  50. package/dist/exchanges/bitget/index.d.ts +7 -0
  51. package/dist/exchanges/bitget/index.js +11 -0
  52. package/dist/exchanges/bitget/index.js.map +1 -0
  53. package/dist/exchanges/bybit/bybit.config.d.ts +10 -0
  54. package/dist/exchanges/bybit/bybit.config.js +7 -0
  55. package/dist/exchanges/bybit/bybit.config.js.map +1 -0
  56. package/dist/exchanges/bybit/bybit.module.d.ts +9 -0
  57. package/dist/exchanges/bybit/bybit.module.js +27 -0
  58. package/dist/exchanges/bybit/bybit.module.js.map +1 -0
  59. package/dist/exchanges/bybit/bybit.service.d.ts +103 -0
  60. package/dist/exchanges/bybit/bybit.service.js +67 -0
  61. package/dist/exchanges/bybit/bybit.service.js.map +1 -0
  62. package/dist/exchanges/bybit/index.d.ts +7 -0
  63. package/dist/exchanges/bybit/index.js +11 -0
  64. package/dist/exchanges/bybit/index.js.map +1 -0
  65. package/dist/exchanges/gate.io/gate.io.config.d.ts +10 -0
  66. package/dist/exchanges/gate.io/gate.io.config.js +7 -0
  67. package/dist/exchanges/gate.io/gate.io.config.js.map +1 -0
  68. package/dist/exchanges/gate.io/gate.io.module.d.ts +9 -0
  69. package/dist/exchanges/gate.io/gate.io.module.js +27 -0
  70. package/dist/exchanges/gate.io/gate.io.module.js.map +1 -0
  71. package/dist/exchanges/gate.io/gate.io.service.d.ts +57 -0
  72. package/dist/exchanges/gate.io/gate.io.service.js +65 -0
  73. package/dist/exchanges/gate.io/gate.io.service.js.map +1 -0
  74. package/dist/exchanges/gate.io/index.d.ts +7 -0
  75. package/dist/exchanges/gate.io/index.js +11 -0
  76. package/dist/exchanges/gate.io/index.js.map +1 -0
  77. package/dist/exchanges/index.d.ts +6 -0
  78. package/dist/exchanges/index.js +6 -0
  79. package/dist/exchanges/index.js.map +1 -1
  80. package/dist/exchanges/lbank/lbank.config.d.ts +2 -2
  81. package/dist/exchanges/lbank/lbank.module.d.ts +1 -1
  82. package/dist/exchanges/lbank/lbank.module.js +1 -2
  83. package/dist/exchanges/lbank/lbank.module.js.map +1 -1
  84. package/dist/exchanges/lbank/lbank.service.d.ts +44 -26
  85. package/dist/exchanges/lbank/lbank.service.js +25 -45
  86. package/dist/exchanges/lbank/lbank.service.js.map +1 -1
  87. package/dist/exchanges/mexc/mexc.config.d.ts +2 -2
  88. package/dist/exchanges/mexc/mexc.module.d.ts +1 -1
  89. package/dist/exchanges/mexc/mexc.module.js +1 -2
  90. package/dist/exchanges/mexc/mexc.module.js.map +1 -1
  91. package/dist/exchanges/mexc/mexc.service.d.ts +3 -2
  92. package/dist/exchanges/mexc/mexc.service.js +12 -13
  93. package/dist/exchanges/mexc/mexc.service.js.map +1 -1
  94. package/dist/exchanges/okx/index.d.ts +7 -0
  95. package/dist/exchanges/okx/index.js +11 -0
  96. package/dist/exchanges/okx/index.js.map +1 -0
  97. package/dist/exchanges/okx/okx.config.d.ts +10 -0
  98. package/dist/exchanges/okx/okx.config.js +7 -0
  99. package/dist/exchanges/okx/okx.config.js.map +1 -0
  100. package/dist/exchanges/okx/okx.module.d.ts +9 -0
  101. package/dist/exchanges/okx/okx.module.js +27 -0
  102. package/dist/exchanges/okx/okx.module.js.map +1 -0
  103. package/dist/exchanges/okx/okx.service.d.ts +72 -0
  104. package/dist/exchanges/okx/okx.service.js +64 -0
  105. package/dist/exchanges/okx/okx.service.js.map +1 -0
  106. package/dist/exchanges/venkate/index.d.ts +7 -0
  107. package/dist/exchanges/venkate/index.js +11 -0
  108. package/dist/exchanges/venkate/index.js.map +1 -0
  109. package/dist/exchanges/venkate/venkate.config.d.ts +10 -0
  110. package/dist/exchanges/venkate/venkate.config.js +7 -0
  111. package/dist/exchanges/venkate/venkate.config.js.map +1 -0
  112. package/dist/exchanges/venkate/venkate.module.d.ts +9 -0
  113. package/dist/exchanges/venkate/venkate.module.js +27 -0
  114. package/dist/exchanges/venkate/venkate.module.js.map +1 -0
  115. package/dist/exchanges/venkate/venkate.service.d.ts +56 -0
  116. package/dist/exchanges/venkate/venkate.service.js +62 -0
  117. package/dist/exchanges/venkate/venkate.service.js.map +1 -0
  118. package/dist/index.d.ts +1 -0
  119. package/dist/index.js +1 -0
  120. package/dist/index.js.map +1 -1
  121. package/dist/logger/logger.module.d.ts +1 -1
  122. package/dist/logger/logger.module.js +1 -2
  123. package/dist/logger/logger.module.js.map +1 -1
  124. package/dist/viabtc/viabtc.module.d.ts +1 -1
  125. package/dist/viabtc/viabtc.module.js +1 -2
  126. package/dist/viabtc/viabtc.module.js.map +1 -1
  127. package/package.json +3 -3
package/README.md CHANGED
@@ -76,7 +76,60 @@ export class MyLoggerModule {
76
76
  {
77
77
  "binance": {
78
78
  "enabled": true,
79
- "url": "https://data-api.binance.vision"
79
+ "url": "https://data-api.binance.vision",
80
+ "url-us": "https://api.binance.us"
81
+ }
82
+ }
83
+ ```
84
+
85
+ ## BingX module
86
+
87
+ ### config
88
+
89
+ ```json
90
+ {
91
+ "bingx": {
92
+ "enabled": true,
93
+ "url": "https://open-api.bingx.com"
94
+ }
95
+ }
96
+ ```
97
+
98
+ ## Bitget module
99
+
100
+ ### config
101
+
102
+ ```json
103
+ {
104
+ "bitget": {
105
+ "enabled": true,
106
+ "url": "https://api.bitget.com"
107
+ }
108
+ }
109
+ ```
110
+
111
+ ## Bybit module
112
+
113
+ ### config
114
+
115
+ ```json
116
+ {
117
+ "bybit": {
118
+ "enabled": true,
119
+ "url": "https://api.bybit.com"
120
+ }
121
+ }
122
+ ```
123
+
124
+ ## Gate.io module
125
+
126
+ ### config
127
+
128
+ ```json
129
+ {
130
+ "gate.io": {
131
+ "enabled": true,
132
+ "url": "https://api.gateio.ws/api/v4"
80
133
  }
81
134
  }
82
135
  ```
@@ -107,6 +160,33 @@ export class MyLoggerModule {
107
160
  }
108
161
  ```
109
162
 
163
+ ## OKX module
164
+
165
+ ### config
166
+
167
+ ```json
168
+ {
169
+ "okx": {
170
+ "enabled": true,
171
+ "url": "https://www.okx.com",
172
+ "url-aws": "https://aws.okx.com"
173
+ }
174
+ }
175
+ ```
176
+
177
+ ## Venkate module
178
+
179
+ ### config
180
+
181
+ ```json
182
+ {
183
+ "venkate": {
184
+ "enabled": true,
185
+ "url": "https://openapi.venkate.io"
186
+ }
187
+ }
188
+ ```
189
+
110
190
  ## CoinGecko module
111
191
 
112
192
  ### config
@@ -5,5 +5,5 @@
5
5
  import { DynamicModule } from '@nestjs/common';
6
6
  import { ConfigOptions } from '../config';
7
7
  export declare class AwsModule {
8
- static forRoot(options?: ConfigOptions): DynamicModule;
8
+ static forRoot(_options?: ConfigOptions): DynamicModule;
9
9
  }
@@ -8,10 +8,9 @@ exports.AwsModule = void 0;
8
8
  const config_1 = require("../config");
9
9
  const aws_service_1 = require("./aws.service");
10
10
  class AwsModule {
11
- static forRoot(options) {
11
+ static forRoot(_options) {
12
12
  return {
13
13
  module: AwsModule,
14
- imports: [config_1.ConfigModule.forRoot(options)],
15
14
  exports: [aws_service_1.AwsService],
16
15
  providers: [
17
16
  {
@@ -1 +1 @@
1
- {"version":3,"file":"aws.module.js","sourceRoot":"","sources":["../../src/aws/aws.module.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,sCAAuE;AAEvE,+CAA2C;AAE3C,MAAa,SAAS;IACpB,MAAM,CAAC,OAAO,CAAC,OAAuB;QACpC,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,CAAC,qBAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACxC,OAAO,EAAE,CAAC,wBAAU,CAAC;YACrB,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,aAAa;oBACtB,UAAU,EAAE,CAAC,QAAkC,EAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE;oBAC1E,MAAM,EAAE,CAAC,sBAAa,CAAC;iBACxB;gBACD,wBAAU;aACX;SACF,CAAC;IACJ,CAAC;CACF;AAhBD,8BAgBC"}
1
+ {"version":3,"file":"aws.module.js","sourceRoot":"","sources":["../../src/aws/aws.module.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,sCAAyD;AAEzD,+CAA2C;AAE3C,MAAa,SAAS;IACpB,MAAM,CAAC,OAAO,CAAC,QAAwB;QACrC,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,CAAC,wBAAU,CAAC;YACrB,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,aAAa;oBACtB,UAAU,EAAE,CAAC,QAAkC,EAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE;oBAC1E,MAAM,EAAE,CAAC,sBAAa,CAAC;iBACxB;gBACD,wBAAU;aACX;SACF,CAAC;IACJ,CAAC;CACF;AAfD,8BAeC"}
@@ -5,5 +5,5 @@
5
5
  import { DynamicModule } from '@nestjs/common';
6
6
  import { ConfigOptions } from '../config';
7
7
  export declare class CoinGeckoModule {
8
- static forRoot(options?: ConfigOptions): DynamicModule;
8
+ static forRoot(_options?: ConfigOptions): DynamicModule;
9
9
  }
@@ -8,10 +8,9 @@ exports.CoinGeckoModule = void 0;
8
8
  const config_1 = require("../config");
9
9
  const coingecko_service_1 = require("./coingecko.service");
10
10
  class CoinGeckoModule {
11
- static forRoot(options) {
11
+ static forRoot(_options) {
12
12
  return {
13
13
  module: CoinGeckoModule,
14
- imports: [config_1.ConfigModule.forRoot(options)],
15
14
  exports: [coingecko_service_1.CoinGeckoService],
16
15
  providers: [
17
16
  {
@@ -1 +1 @@
1
- {"version":3,"file":"coingecko.module.js","sourceRoot":"","sources":["../../src/coingecko/coingecko.module.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,sCAAuE;AACvE,2DAAuD;AAEvD,MAAa,eAAe;IAC1B,MAAM,CAAC,OAAO,CAAC,OAAuB;QACpC,OAAO;YACL,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,CAAC,qBAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACxC,OAAO,EAAE,CAAC,oCAAgB,CAAC;YAC3B,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,mBAAmB;oBAC5B,UAAU,EAAE,CAAC,QAAwC,EAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE;oBAChF,MAAM,EAAE,CAAC,sBAAa,CAAC;iBACxB;gBACD,oCAAgB;aACjB;SACF,CAAC;IACJ,CAAC;CACF;AAhBD,0CAgBC"}
1
+ {"version":3,"file":"coingecko.module.js","sourceRoot":"","sources":["../../src/coingecko/coingecko.module.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,sCAAyD;AAEzD,2DAAuD;AAEvD,MAAa,eAAe;IAC1B,MAAM,CAAC,OAAO,CAAC,QAAwB;QACrC,OAAO;YACL,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,CAAC,oCAAgB,CAAC;YAC3B,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,mBAAmB;oBAC5B,UAAU,EAAE,CAAC,QAAwC,EAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE;oBAChF,MAAM,EAAE,CAAC,sBAAa,CAAC;iBACxB;gBACD,oCAAgB;aACjB;SACF,CAAC;IACJ,CAAC;CACF;AAfD,0CAeC"}
@@ -12,9 +12,9 @@ const axios_1 = tslib_1.__importDefault(require("axios"));
12
12
  let CoinGeckoService = class CoinGeckoService {
13
13
  constructor(constant) {
14
14
  this.constant = constant;
15
- const config = { baseURL: this.constant.coingecko.url };
16
- if (this.constant.coingecko.apiKey) {
17
- config.params = { [this.constant.coingecko.isPro ? 'x_cg_pro_api_key' : 'x_cg_api_key']: this.constant.coingecko.apiKey };
15
+ const config = { baseURL: constant.coingecko.url };
16
+ if (constant.coingecko.apiKey) {
17
+ config.params = { [constant.coingecko.isPro ? 'x_cg_pro_api_key' : 'x_cg_api_key']: constant.coingecko.apiKey };
18
18
  }
19
19
  this.instance = axios_1.default.create(config);
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"coingecko.service.js","sourceRoot":"","sources":["../../src/coingecko/coingecko.service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;AAEH,2CAA+E;AAC/E,0DAAkE;AAI3D,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAG3B,YAA0D,QAAyB;QAAzB,aAAQ,GAAR,QAAQ,CAAiB;QACjF,MAAM,MAAM,GAAwB,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;QAC7E,IAAI,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;YACnC,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;QAC5H,CAAC;QACD,IAAI,CAAC,QAAQ,GAAG,eAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,UAAU,C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 * @file api.list.response.decorator.ts
3
+ * @date 2024
4
+ */
5
+ import { Type } from '@nestjs/common';
6
+ export declare const ApiListResponse: <TModel extends Type<any>>(model: TModel, description?: string) => any;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ /**
3
+ * @file api.list.response.decorator.ts
4
+ * @date 2024
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.ApiListResponse = void 0;
8
+ const common_1 = require("@nestjs/common");
9
+ const swagger_1 = require("@nestjs/swagger");
10
+ const response_dto_1 = require("./response.dto");
11
+ const ApiListResponse = (model, description) => {
12
+ return (0, common_1.applyDecorators)((0, swagger_1.ApiOkResponse)({
13
+ schema: {
14
+ allOf: [
15
+ { $ref: (0, swagger_1.getSchemaPath)(response_dto_1.ResponseListDto) },
16
+ {
17
+ properties: {
18
+ // code: { type: 'number', default: 0 },
19
+ // message: { type: 'string', default: 'OK' },
20
+ data: {
21
+ type: 'array',
22
+ items: { $ref: (0, swagger_1.getSchemaPath)(model) },
23
+ },
24
+ },
25
+ },
26
+ ],
27
+ },
28
+ description,
29
+ }), (0, swagger_1.ApiExtraModels)(response_dto_1.ResponseListDto), (0, swagger_1.ApiExtraModels)(model));
30
+ };
31
+ exports.ApiListResponse = ApiListResponse;
32
+ //# sourceMappingURL=api.list.response.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.list.response.decorator.js","sourceRoot":"","sources":["../../src/decorators/api.list.response.decorator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2CAAuD;AACvD,6CAA+E;AAC/E,iDAAiD;AAE1C,MAAM,eAAe,GAAG,CAA2B,KAAa,EAAE,WAAoB,EAAO,EAAE;IACpG,OAAO,IAAA,wBAAe,EACpB,IAAA,uBAAa,EAAC;QACZ,MAAM,EAAE;YACN,KAAK,EAAE;gBACL,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,8BAAe,CAAC,EAAE;gBACxC;oBACE,UAAU,EAAE;wBACV,wCAAwC;wBACxC,8CAA8C;wBAC9C,IAAI,EAAE;4BACJ,IAAI,EAAE,OAAO;4BACb,KAAK,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,KAAK,CAAC,EAAE;yBACtC;qBACF;iBACF;aACF;SACF;QACD,WAAW;KACZ,CAAC,EACF,IAAA,wBAAc,EAAC,8BAAe,CAAC,EAC/B,IAAA,wBAAc,EAAC,KAAK,CAAC,CACtB,CAAC;AACJ,CAAC,CAAC;AAvBW,QAAA,eAAe,mBAuB1B"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @file api.obj.response.decorator.ts
3
+ * @date 2024
4
+ */
5
+ import { Type } from '@nestjs/common';
6
+ export declare const ApiObjResponse: <TModel extends Type<any>>(model: TModel, description?: string) => any;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ /**
3
+ * @file api.obj.response.decorator.ts
4
+ * @date 2024
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.ApiObjResponse = void 0;
8
+ const common_1 = require("@nestjs/common");
9
+ const swagger_1 = require("@nestjs/swagger");
10
+ const response_dto_1 = require("./response.dto");
11
+ const ApiObjResponse = (model, description) => {
12
+ return (0, common_1.applyDecorators)((0, swagger_1.ApiOkResponse)({
13
+ schema: {
14
+ allOf: [
15
+ { $ref: (0, swagger_1.getSchemaPath)(response_dto_1.ResponseObjDto) },
16
+ {
17
+ properties: {
18
+ // code: { type: 'number', default: 0 },
19
+ // message: { type: 'string', default: 'OK' },
20
+ data: { $ref: (0, swagger_1.getSchemaPath)(model) },
21
+ },
22
+ },
23
+ ],
24
+ },
25
+ description,
26
+ }), (0, swagger_1.ApiExtraModels)(response_dto_1.ResponseObjDto), (0, swagger_1.ApiExtraModels)(model));
27
+ };
28
+ exports.ApiObjResponse = ApiObjResponse;
29
+ //# sourceMappingURL=api.obj.response.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.obj.response.decorator.js","sourceRoot":"","sources":["../../src/decorators/api.obj.response.decorator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2CAAuD;AACvD,6CAA+E;AAC/E,iDAAgD;AAEzC,MAAM,cAAc,GAAG,CAA2B,KAAa,EAAE,WAAoB,EAAO,EAAE;IACnG,OAAO,IAAA,wBAAe,EACpB,IAAA,uBAAa,EAAC;QACZ,MAAM,EAAE;YACN,KAAK,EAAE;gBACL,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,6BAAc,CAAC,EAAE;gBACvC;oBACE,UAAU,EAAE;wBACV,wCAAwC;wBACxC,8CAA8C;wBAC9C,IAAI,EAAE,EAAE,IAAI,EAAE,IAAA,uBAAa,EAAC,KAAK,CAAC,EAAE;qBACrC;iBACF;aACF;SACF;QACD,WAAW;KACZ,CAAC,EACF,IAAA,wBAAc,EAAC,6BAAc,CAAC,EAC9B,IAAA,wBAAc,EAAC,KAAK,CAAC,CACtB,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,cAAc,kBAoBzB"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @file index.ts
3
+ * @date 2024
4
+ */
5
+ export * from './response.dto';
6
+ export * from './api.list.response.decorator';
7
+ export * from './api.obj.response.decorator';
@@ -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("./response.dto"), exports);
9
+ tslib_1.__exportStar(require("./api.list.response.decorator"), exports);
10
+ tslib_1.__exportStar(require("./api.obj.response.decorator"), exports);
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yDAA+B;AAC/B,wEAA8C;AAC9C,uEAA6C"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @file response.dto.ts
3
+ * @date 2024
4
+ */
5
+ export declare class ResponseDto {
6
+ code: number;
7
+ message: string;
8
+ reason?: string;
9
+ }
10
+ export declare class ResponseObjDto<TData> extends ResponseDto {
11
+ data: TData;
12
+ }
13
+ export declare class ResponseListDto<TData> extends ResponseDto {
14
+ data: TData[];
15
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ /**
3
+ * @file response.dto.ts
4
+ * @date 2024
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.ResponseListDto = exports.ResponseObjDto = exports.ResponseDto = void 0;
8
+ const tslib_1 = require("tslib");
9
+ const swagger_1 = require("@nestjs/swagger");
10
+ class ResponseDto {
11
+ }
12
+ exports.ResponseDto = ResponseDto;
13
+ tslib_1.__decorate([
14
+ (0, swagger_1.ApiProperty)({ description: 'The result code, 0 means success, greater than 0 means failure.', example: 0 })
15
+ ], ResponseDto.prototype, "code", void 0);
16
+ tslib_1.__decorate([
17
+ (0, swagger_1.ApiProperty)({ description: 'The result message', example: 'OK' })
18
+ ], ResponseDto.prototype, "message", void 0);
19
+ tslib_1.__decorate([
20
+ (0, swagger_1.ApiPropertyOptional)({ description: 'The failure reason.' })
21
+ ], ResponseDto.prototype, "reason", void 0);
22
+ class ResponseObjDto extends ResponseDto {
23
+ }
24
+ exports.ResponseObjDto = ResponseObjDto;
25
+ tslib_1.__decorate([
26
+ (0, swagger_1.ApiProperty)()
27
+ ], ResponseObjDto.prototype, "data", void 0);
28
+ class ResponseListDto extends ResponseDto {
29
+ }
30
+ exports.ResponseListDto = ResponseListDto;
31
+ tslib_1.__decorate([
32
+ (0, swagger_1.ApiProperty)()
33
+ ], ResponseListDto.prototype, "data", void 0);
34
+ //# sourceMappingURL=response.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.dto.js","sourceRoot":"","sources":["../../src/decorators/response.dto.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,6CAAmE;AAEnE,MAAa,WAAW;CASvB;AATD,kCASC;AAPC;IADC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iEAAiE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;yCAC/F;AAGb;IADC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAClD;AAGhB;IADC,IAAA,6BAAmB,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;2CAC5C;AAGlB,MAAa,cAAsB,SAAQ,WAAW;CAGrD;AAHD,wCAGC;AADC;IADC,IAAA,qBAAW,GAAE;4CACF;AAGd,MAAa,eAAuB,SAAQ,WAAW;CAGtD;AAHD,0CAGC;AADC;IADC,IAAA,qBAAW,GAAE;6CACA"}
@@ -3,8 +3,8 @@
3
3
  * @date 2023
4
4
  */
5
5
  export interface BinanceConfig {
6
- binance: {
6
+ binance?: {
7
7
  enabled: boolean;
8
- url?: string;
8
+ url: string;
9
9
  };
10
10
  }
@@ -5,5 +5,5 @@
5
5
  import { DynamicModule } from '@nestjs/common';
6
6
  import { ConfigOptions } from '../../config';
7
7
  export declare class BinanceModule {
8
- static forRoot(options?: ConfigOptions): DynamicModule;
8
+ static forRoot(_options?: ConfigOptions): DynamicModule;
9
9
  }
@@ -8,10 +8,9 @@ exports.BinanceModule = void 0;
8
8
  const config_1 = require("../../config");
9
9
  const binance_service_1 = require("./binance.service");
10
10
  class BinanceModule {
11
- static forRoot(options) {
11
+ static forRoot(_options) {
12
12
  return {
13
13
  module: BinanceModule,
14
- imports: [config_1.ConfigModule.forRoot(options)],
15
14
  exports: [binance_service_1.BinanceService],
16
15
  providers: [
17
16
  {
@@ -1 +1 @@
1
- {"version":3,"file":"binance.module.js","sourceRoot":"","sources":["../../../src/exchanges/binance/binance.module.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yCAA0E;AAE1E,uDAAmD;AAEnD,MAAa,aAAa;IACxB,MAAM,CAAC,OAAO,CAAC,OAAuB;QACpC,OAAO;YACL,MAAM,EAAE,aAAa;YACrB,OAAO,EAAE,CAAC,qBAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACxC,OAAO,EAAE,CAAC,gCAAc,CAAC;YACzB,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,iBAAiB;oBAC1B,UAAU,EAAE,CAAC,QAAsC,EAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE;oBAC9E,MAAM,EAAE,CAAC,sBAAa,CAAC;iBACxB;gBACD,gCAAc;aACf;SACF,CAAC;IACJ,CAAC;CACF;AAhBD,sCAgBC"}
1
+ {"version":3,"file":"binance.module.js","sourceRoot":"","sources":["../../../src/exchanges/binance/binance.module.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yCAA4D;AAE5D,uDAAmD;AAEnD,MAAa,aAAa;IACxB,MAAM,CAAC,OAAO,CAAC,QAAwB;QACrC,OAAO;YACL,MAAM,EAAE,aAAa;YACrB,OAAO,EAAE,CAAC,gCAAc,CAAC;YACzB,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,iBAAiB;oBAC1B,UAAU,EAAE,CAAC,QAAsC,EAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE;oBAC9E,MAAM,EAAE,CAAC,sBAAa,CAAC;iBACxB;gBACD,gCAAc;aACf;SACF,CAAC;IACJ,CAAC;CACF;AAfD,sCAeC"}
@@ -8,6 +8,7 @@ export declare class BinanceService {
8
8
  private readonly constant;
9
9
  private readonly instance;
10
10
  constructor(constant: BinanceConfig);
11
+ checkConstant(): void;
11
12
  /**
12
13
  * Market Data - Current Average Price
13
14
  * @param symbol e.g. BTCUSDT
@@ -16,6 +17,7 @@ export declare class BinanceService {
16
17
  avgPrice(symbol: string): Promise<{
17
18
  mins: number;
18
19
  price: string;
20
+ closeTime: number;
19
21
  }>;
20
22
  /**
21
23
  * Market Data - 24hr Ticker Price Change Statistics
@@ -51,17 +53,18 @@ export declare class BinanceService {
51
53
  * @param interval e.g. 1d
52
54
  * @param startTime e.g. 1696089600000
53
55
  * @param endTime e.g. 1698918180000
56
+ * @param timeZone e.g. 0 (UTC)
54
57
  * @param limit e.g. 500
55
58
  * @see https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data
56
59
  */
57
- klines(symbol: string, interval: '1m' | '3m' | '5m' | '15m' | '30m' | '1h' | '2h' | '4h' | '6h' | '8h' | '12h' | '1d' | '3d' | '1w' | '1M', startTime?: string | number, endTime?: string | number, limit?: number): Promise<[number, string, string, string, string, string, number, string, number, string, string, string][]>;
60
+ klines(symbol: string, interval: '1m' | '3m' | '5m' | '15m' | '30m' | '1h' | '2h' | '4h' | '6h' | '8h' | '12h' | '1d' | '3d' | '1w' | '1M', startTime?: string | number, endTime?: string | number, timeZone?: string, limit?: string | number): Promise<[number, string, string, string, string, string, number, string, number, string, string, string][]>;
58
61
  /**
59
62
  * Market Data - Order Book
60
63
  * @param symbol e.g. BTCUSDT
61
- * @param limit e.g. 500
64
+ * @param limit e.g. 100
62
65
  * @see https://binance-docs.github.io/apidocs/spot/en/#order-book
63
66
  */
64
- depth(symbol: string, limit?: number): Promise<{
67
+ depth(symbol: string, limit?: string | number): Promise<{
65
68
  lastUpdateId: number;
66
69
  bids: [string, string][];
67
70
  asks: [string, string][];
@@ -12,7 +12,14 @@ const axios_1 = tslib_1.__importDefault(require("axios"));
12
12
  let BinanceService = class BinanceService {
13
13
  constructor(constant) {
14
14
  this.constant = constant;
15
- this.instance = axios_1.default.create({ baseURL: this.constant.binance.url });
15
+ if (constant.binance?.enabled) {
16
+ this.instance = axios_1.default.create({ baseURL: constant.binance.url });
17
+ }
18
+ }
19
+ checkConstant() {
20
+ if (!this.constant.binance?.enabled) {
21
+ throw new common_1.HttpException('This feature is not supported', common_1.HttpStatus.BAD_REQUEST);
22
+ }
16
23
  }
17
24
  /**
18
25
  * Market Data - Current Average Price
@@ -20,9 +27,7 @@ let BinanceService = class BinanceService {
20
27
  * @see https://binance-docs.github.io/apidocs/spot/en/#current-average-price
21
28
  */
22
29
  async avgPrice(symbol) {
23
- if (!this.constant.binance?.enabled) {
24
- throw new common_1.HttpException('This feature is not supported', common_1.HttpStatus.BAD_REQUEST);
25
- }
30
+ this.checkConstant();
26
31
  return (await this.instance.get('/api/v3/avgPrice', { params: { symbol } })).data;
27
32
  }
28
33
  /**
@@ -31,9 +36,7 @@ let BinanceService = class BinanceService {
31
36
  * @see https://binance-docs.github.io/apidocs/spot/en/#24hr-ticker-price-change-statistics
32
37
  */
33
38
  async ticker(symbol) {
34
- if (!this.constant.binance?.enabled) {
35
- throw new common_1.HttpException('This feature is not supported', common_1.HttpStatus.BAD_REQUEST);
36
- }
39
+ this.checkConstant();
37
40
  return (await this.instance.get('/api/v3/ticker/24hr', { params: { symbol } })).data;
38
41
  }
39
42
  /**
@@ -42,25 +45,22 @@ let BinanceService = class BinanceService {
42
45
  * @param interval e.g. 1d
43
46
  * @param startTime e.g. 1696089600000
44
47
  * @param endTime e.g. 1698918180000
48
+ * @param timeZone e.g. 0 (UTC)
45
49
  * @param limit e.g. 500
46
50
  * @see https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data
47
51
  */
48
- async klines(symbol, interval, startTime, endTime, limit) {
49
- if (!this.constant.binance?.enabled) {
50
- throw new common_1.HttpException('This feature is not supported', common_1.HttpStatus.BAD_REQUEST);
51
- }
52
- return (await this.instance.get('/api/v3/klines', { params: { symbol, interval, startTime, endTime, limit } })).data;
52
+ async klines(symbol, interval, startTime, endTime, timeZone, limit) {
53
+ this.checkConstant();
54
+ return (await this.instance.get('/api/v3/klines', { params: { symbol, interval, startTime, endTime, timeZone, limit } })).data;
53
55
  }
54
56
  /**
55
57
  * Market Data - Order Book
56
58
  * @param symbol e.g. BTCUSDT
57
- * @param limit e.g. 500
59
+ * @param limit e.g. 100
58
60
  * @see https://binance-docs.github.io/apidocs/spot/en/#order-book
59
61
  */
60
62
  async depth(symbol, limit) {
61
- if (!this.constant.binance?.enabled) {
62
- throw new common_1.HttpException('This feature is not supported', common_1.HttpStatus.BAD_REQUEST);
63
- }
63
+ this.checkConstant();
64
64
  return (await this.instance.get('/api/v3/depth', { params: { symbol, limit } })).data;
65
65
  }
66
66
  };
@@ -1 +1 @@
1
- {"version":3,"file":"binance.service.js","sourceRoot":"","sources":["../../../src/exchanges/binance/binance.service.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;AAEH,2CAA+E;AAC/E,0DAA6C;AAItC,IAAM,cAAc,GAApB,MAAM,cAAc;IAGzB,YAAwD,QAAuB;QAAvB,aAAQ,GAAR,QAAQ,CAAe;QAC7E,IAAI,CAAC,QAAQ,GAAG,eAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACvE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAQ,CAAC,MAAc;QAC3B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC;YACpC,MAAM,IAAI,sBAAa,CAAC,+BAA+B,EAAE,mBAAU,CAAC,WAAW,CAAC,CAAC;QACnF,CAAC;QACD,OAAO,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACpF,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,MAAc;QAuBzB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC;YACpC,MAAM,IAAI,sBAAa,CAAC,+BAA+B,EAAE,mBAAU,CAAC,WAAW,CAAC,CAAC;QACnF,CAAC;QACD,OAAO,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,qBAAqB,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACvF,CAAC;IAED;;;;;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CAAC;IACjI,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,KAAK,CAAC,MAAc,EAAE,KAAuB;QACjD,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,OAAO,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACxF,CAAC;CACF,CAAA;AAzFY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAIE,mBAAA,IAAA,eAAM,EAAC,iBAAiB,CAAC,CAAA;GAH3B,cAAc,CAyF1B"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @file bingx.config.ts
3
+ * @date 2024
4
+ */
5
+ export interface BingxConfig {
6
+ bingx?: {
7
+ enabled: boolean;
8
+ url: string;
9
+ };
10
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * @file bingx.config.ts
4
+ * @date 2024
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=bingx.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bingx.config.js","sourceRoot":"","sources":["../../../src/exchanges/bingx/bingx.config.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @file bingx.module.ts
3
+ * @date 2024
4
+ */
5
+ import { DynamicModule } from '@nestjs/common';
6
+ import { ConfigOptions } from '../../config';
7
+ export declare class BingxModule {
8
+ static forRoot(_options?: ConfigOptions): DynamicModule;
9
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * @file bingx.module.ts
4
+ * @date 2024
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.BingxModule = void 0;
8
+ const config_1 = require("../../config");
9
+ const bingx_service_1 = require("./bingx.service");
10
+ class BingxModule {
11
+ static forRoot(_options) {
12
+ return {
13
+ module: BingxModule,
14
+ exports: [bingx_service_1.BingxService],
15
+ providers: [
16
+ {
17
+ provide: 'BingxConstant',
18
+ useFactory: (constant) => constant.config(),
19
+ inject: [config_1.ConfigService],
20
+ },
21
+ bingx_service_1.BingxService,
22
+ ],
23
+ };
24
+ }
25
+ }
26
+ exports.BingxModule = BingxModule;
27
+ //# sourceMappingURL=bingx.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bingx.module.js","sourceRoot":"","sources":["../../../src/exchanges/bingx/bingx.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,73 @@
1
+ /**
2
+ * @file bingx.service.ts
3
+ * @date 2024
4
+ * @see https://bingx-api.github.io/docs/#/en-us/spot/market-api.html
5
+ */
6
+ import { BingxConfig } from './bingx.config';
7
+ export declare class BingxService {
8
+ private readonly constant;
9
+ private readonly instance;
10
+ constructor(constant: BingxConfig);
11
+ checkConstant(): void;
12
+ /**
13
+ * Get Ticker
14
+ * @param symbol There must be a hyphen "-" in the trading pair symbol. e.g. BTC-USDT
15
+ * @param timestamp Request valid time window value, Unit: milliseconds. e.g. 1702720770200
16
+ * @param recvWindow Timestamp of initiating the request, Unit: milliseconds. e.g. 1702720770200
17
+ * @see https://bingx-api.github.io/docs/#/en-us/spot/market-api.html#24hr%20Ticker%20Price%20Change%20Statistics
18
+ */
19
+ ticker(symbol: string, timestamp: string | number, recvWindow?: string | number): Promise<{
20
+ code: number;
21
+ timestamp: number;
22
+ data: {
23
+ symbol: string;
24
+ openPrice: number;
25
+ highPrice: number;
26
+ lowPrice: number;
27
+ lastPrice: number;
28
+ priceChange: number;
29
+ priceChangePercent: string;
30
+ volume: number;
31
+ quoteVolume: number;
32
+ openTime: number;
33
+ closeTime: number;
34
+ askPrice: number;
35
+ askQty: number;
36
+ bidPrice: number;
37
+ bidQty: number;
38
+ }[];
39
+ }>;
40
+ /**
41
+ * Kline/Candlestick Data
42
+ * @param symbol There must be a hyphen "-" in the trading pair symbol. e.g. BTC-USDT
43
+ * @param interval Request valid time window value, Unit: milliseconds. e.g. 1d
44
+ * @param timestamp Request valid time window value, Unit: milliseconds. e.g. 1702720770200
45
+ * @param startTime Start time, unit: millisecond. e.g. 1696089600000
46
+ * @param endTime End time, unit: millisecond. e.g. 1698918180000
47
+ * @param limit e.g. 500
48
+ * @param recvWindow Timestamp of initiating the request, Unit: milliseconds. e.g. 1702720770200
49
+ * @see https://bingx-api.github.io/docs/#/en-us/spot/market-api.html#Kline/Candlestick%20Data
50
+ */
51
+ klines(symbol: string, interval: '1m' | '3m' | '5m' | '15m' | '30m' | '1h' | '2h' | '4h' | '6h' | '8h' | '12h' | '1d' | '3d' | '1w' | '1M', timestamp: string | number, startTime?: string | number, endTime?: string | number, limit?: string | number, recvWindow?: string | number): Promise<{
52
+ code: number;
53
+ timestamp: number;
54
+ data: [number, number, number, number, number, number, number, number][];
55
+ }>;
56
+ /**
57
+ * Order Book aggregation
58
+ * @param symbol Trading pair. e.g. BTC-USDT
59
+ * @param timestamp Request valid time window value, Unit: milliseconds. e.g. 1702720770200
60
+ * @param limit Default 20, optional value:[5, 10, 20, 50, 100, 500, 1000]
61
+ * @param recvWindow Timestamp of initiating the request, Unit: milliseconds. e.g. 1702720770200
62
+ * @see https://bingx-api.github.io/docs/#/en-us/spot/market-api.html#Order%20Book%20aggregation
63
+ */
64
+ depth(symbol: string, timestamp: string | number, limit?: string | number, recvWindow?: string | number): Promise<{
65
+ code: number;
66
+ timestamp: number;
67
+ data: {
68
+ bids: [string, string][];
69
+ asks: [string, string][];
70
+ tx: number;
71
+ };
72
+ }>;
73
+ }