@yuants/vendor-huobi 0.15.1 → 0.15.3

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.
@@ -22,15 +22,14 @@ createSeriesProvider(Terminal.fromNodeEnv(), {
22
22
  serviceOptions: { concurrent: 10 },
23
23
  queryFn: function ({ series_id, started_at }) {
24
24
  return __asyncGenerator(this, arguments, function* () {
25
- const [datasource_id, product_id] = decodePath(series_id);
26
- const [, instType] = decodePath(product_id);
25
+ const [, instType, contract_code] = decodePath(series_id);
27
26
  if (instType === 'SWAP') {
28
27
  let current_page = 0;
29
28
  let total_page = 1;
30
29
  while (true) {
31
30
  // 向前翻页,时间降序
32
31
  const res = yield __await(getSwapHistoricalFundingRate({
33
- contract_code: product_id,
32
+ contract_code: contract_code,
34
33
  page_index: current_page,
35
34
  }));
36
35
  if (res.status !== 'ok') {
@@ -40,8 +39,8 @@ createSeriesProvider(Terminal.fromNodeEnv(), {
40
39
  break;
41
40
  yield yield __await(res.data.data.map((v) => ({
42
41
  series_id,
43
- datasource_id,
44
- product_id,
42
+ datasource_id: 'HTX',
43
+ product_id: series_id,
45
44
  created_at: formatTime(+v.funding_time),
46
45
  long_rate: `${-v.funding_rate}`,
47
46
  short_rate: `${v.funding_rate}`,
@@ -1 +1 @@
1
- {"version":3,"file":"interest_rate.js","sourceRoot":"","sources":["../../../src/services/market-data/interest_rate.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAEpE,oBAAoB,CAAgB,QAAQ,CAAC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U,CAAC;oBACjC,YAAY,EAAE,CAAC;oBACf,IAAI,YAAY,IAAI,UAAU;wBAAE,MAAM;oBACtC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,YAAY,IAAI,UAAU;wBAAE,MAAM;oBAC/E,cAAM,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA,CAAC;iBACnC;aACF;YACD,MAAM,QAAQ,CAAC,uBAAuB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACxD,CAAC;KAAA;CACF,CAAC,CAAC","sourcesContent":["import { IInterestRate } from '@yuants/data-interest-rate';\nimport { createSeriesProvider } from '@yuants/data-series';\nimport { Terminal } from '@yuants/protocol';\nimport { decodePath, formatTime, newError } from '@yuants/utils';\nimport { firstValueFrom, timer } from 'rxjs';\nimport { getSwapHistoricalFundingRate } from '../../api/public-api';\n\ncreateSeriesProvider<IInterestRate>(Terminal.fromNodeEnv(), {\n tableName: 'interest_rate',\n series_id_prefix_parts: ['HTX'],\n reversed: true,\n serviceOptions: { concurrent: 10 },\n queryFn: async function* ({ series_id, started_at }) {\n const [datasource_id, product_id] = decodePath(series_id);\n const [, instType] = decodePath(product_id);\n\n if (instType === 'SWAP') {\n let current_page = 0;\n let total_page = 1;\n while (true) {\n // 向前翻页,时间降序\n const res = await getSwapHistoricalFundingRate({\n contract_code: product_id,\n page_index: current_page,\n });\n if (res.status !== 'ok') {\n throw `API failed: ${res.status}`;\n }\n if (res.data.data.length === 0) break;\n yield res.data.data.map(\n (v): IInterestRate => ({\n series_id,\n datasource_id,\n product_id,\n created_at: formatTime(+v.funding_time),\n long_rate: `${-v.funding_rate}`,\n short_rate: `${v.funding_rate}`,\n settlement_price: '',\n }),\n );\n total_page = res.data.total_page;\n current_page++;\n if (current_page >= total_page) break;\n if (+res.data.data[res.data.data.length - 1].funding_time <= started_at) break;\n await firstValueFrom(timer(1000));\n }\n }\n throw newError('UNSUPPORTED_INST_TYPE', { instType });\n },\n});\n"]}
1
+ {"version":3,"file":"interest_rate.js","sourceRoot":"","sources":["../../../src/services/market-data/interest_rate.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAEpE,oBAAoB,CAAgB,QAAQ,CAAC,WAAW,EAAE,EAAE;IAC1D,SAAS,EAAE,eAAe;IAC1B,sBAAsB,EAAE,CAAC,KAAK,CAAC;IAC/B,QAAQ,EAAE,IAAI;IACd,cAAc,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;IAClC,OAAO,EAAE,UAAiB,EAAE,SAAS,EAAE,UAAU,EAAE;;YACjD,MAAM,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;YAE1D,IAAI,QAAQ,KAAK,MAAM,EAAE;gBACvB,IAAI,YAAY,GAAG,CAAC,CAAC;gBACrB,IAAI,UAAU,GAAG,CAAC,CAAC;gBACnB,OAAO,IAAI,EAAE;oBACX,YAAY;oBACZ,MAAM,GAAG,GAAG,cAAM,4BAA4B,CAAC;wBAC7C,aAAa,EAAE,aAAa;wBAC5B,UAAU,EAAE,YAAY;qBACzB,CAAC,CAAA,CAAC;oBACH,IAAI,GAAG,CAAC,MAAM,KAAK,IAAI,EAAE;wBACvB,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,CAAC;qBACnC;oBACD,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;wBAAE,MAAM;oBACtC,oBAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACrB,CAAC,CAAC,EAAiB,EAAE,CAAC,CAAC;wBACrB,SAAS;wBACT,aAAa,EAAE,KAAK;wBACpB,UAAU,EAAE,SAAS;wBACrB,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;wBACvC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,YAAY,EAAE;wBAC/B,UAAU,EAAE,GAAG,CAAC,CAAC,YAAY,EAAE;wBAC/B,gBAAgB,EAAE,EAAE;qBACrB,CAAC,CACH,CAAA,CAAC;oBACF,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;oBACjC,YAAY,EAAE,CAAC;oBACf,IAAI,YAAY,IAAI,UAAU;wBAAE,MAAM;oBACtC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,YAAY,IAAI,UAAU;wBAAE,MAAM;oBAC/E,cAAM,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA,CAAC;iBACnC;aACF;YACD,MAAM,QAAQ,CAAC,uBAAuB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACxD,CAAC;KAAA;CACF,CAAC,CAAC","sourcesContent":["import { IInterestRate } from '@yuants/data-interest-rate';\nimport { createSeriesProvider } from '@yuants/data-series';\nimport { Terminal } from '@yuants/protocol';\nimport { decodePath, formatTime, newError } from '@yuants/utils';\nimport { firstValueFrom, timer } from 'rxjs';\nimport { getSwapHistoricalFundingRate } from '../../api/public-api';\n\ncreateSeriesProvider<IInterestRate>(Terminal.fromNodeEnv(), {\n tableName: 'interest_rate',\n series_id_prefix_parts: ['HTX'],\n reversed: true,\n serviceOptions: { concurrent: 10 },\n queryFn: async function* ({ series_id, started_at }) {\n const [, instType, contract_code] = decodePath(series_id);\n\n if (instType === 'SWAP') {\n let current_page = 0;\n let total_page = 1;\n while (true) {\n // 向前翻页,时间降序\n const res = await getSwapHistoricalFundingRate({\n contract_code: contract_code,\n page_index: current_page,\n });\n if (res.status !== 'ok') {\n throw `API failed: ${res.status}`;\n }\n if (res.data.data.length === 0) break;\n yield res.data.data.map(\n (v): IInterestRate => ({\n series_id,\n datasource_id: 'HTX',\n product_id: series_id,\n created_at: formatTime(+v.funding_time),\n long_rate: `${-v.funding_rate}`,\n short_rate: `${v.funding_rate}`,\n settlement_price: '',\n }),\n );\n total_page = res.data.total_page;\n current_page++;\n if (current_page >= total_page) break;\n if (+res.data.data[res.data.data.length - 1].funding_time <= started_at) break;\n await firstValueFrom(timer(1000));\n }\n }\n throw newError('UNSUPPORTED_INST_TYPE', { instType });\n },\n});\n"]}
@@ -24,15 +24,14 @@ const public_api_1 = require("../../api/public-api");
24
24
  serviceOptions: { concurrent: 10 },
25
25
  queryFn: function ({ series_id, started_at }) {
26
26
  return __asyncGenerator(this, arguments, function* () {
27
- const [datasource_id, product_id] = (0, utils_1.decodePath)(series_id);
28
- const [, instType] = (0, utils_1.decodePath)(product_id);
27
+ const [, instType, contract_code] = (0, utils_1.decodePath)(series_id);
29
28
  if (instType === 'SWAP') {
30
29
  let current_page = 0;
31
30
  let total_page = 1;
32
31
  while (true) {
33
32
  // 向前翻页,时间降序
34
33
  const res = yield __await((0, public_api_1.getSwapHistoricalFundingRate)({
35
- contract_code: product_id,
34
+ contract_code: contract_code,
36
35
  page_index: current_page,
37
36
  }));
38
37
  if (res.status !== 'ok') {
@@ -42,8 +41,8 @@ const public_api_1 = require("../../api/public-api");
42
41
  break;
43
42
  yield yield __await(res.data.data.map((v) => ({
44
43
  series_id,
45
- datasource_id,
46
- product_id,
44
+ datasource_id: 'HTX',
45
+ product_id: series_id,
47
46
  created_at: (0, utils_1.formatTime)(+v.funding_time),
48
47
  long_rate: `${-v.funding_rate}`,
49
48
  short_rate: `${v.funding_rate}`,
@@ -1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,EAAC,CAAC,CAAC,CAAC,YAAY,CAAC;wBACvC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,YAAY,EAAE;wBAC/B,UAAU,EAAE,GAAG,CAAC,CAAC,YAAY,EAAE;wBAC/B,gBAAgB,EAAE,EAAE;qBACrB,CAAC,CACH,CAAA,CAAC;oBACF,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;oBACjC,YAAY,EAAE,CAAC;oBACf,IAAI,YAAY,IAAI,UAAU;wBAAE,MAAM;oBACtC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,YAAY,IAAI,UAAU;wBAAE,MAAM;oBAC/E,cAAM,IAAA,qBAAc,EAAC,IAAA,YAAK,EAAC,IAAI,CAAC,CAAC,CAAA,CAAC;iBACnC;aACF;YACD,MAAM,IAAA,gBAAQ,EAAC,uBAAuB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACxD,CAAC;KAAA;CACF,CAAC,CAAC","sourcesContent":["import { IInterestRate } from '@yuants/data-interest-rate';\nimport { createSeriesProvider } from '@yuants/data-series';\nimport { Terminal } from '@yuants/protocol';\nimport { decodePath, formatTime, newError } from '@yuants/utils';\nimport { firstValueFrom, timer } from 'rxjs';\nimport { getSwapHistoricalFundingRate } from '../../api/public-api';\n\ncreateSeriesProvider<IInterestRate>(Terminal.fromNodeEnv(), {\n tableName: 'interest_rate',\n series_id_prefix_parts: ['HTX'],\n reversed: true,\n serviceOptions: { concurrent: 10 },\n queryFn: async function* ({ series_id, started_at }) {\n const [datasource_id, product_id] = decodePath(series_id);\n const [, instType] = decodePath(product_id);\n\n if (instType === 'SWAP') {\n let current_page = 0;\n let total_page = 1;\n while (true) {\n // 向前翻页,时间降序\n const res = await getSwapHistoricalFundingRate({\n contract_code: product_id,\n page_index: current_page,\n });\n if (res.status !== 'ok') {\n throw `API failed: ${res.status}`;\n }\n if (res.data.data.length === 0) break;\n yield res.data.data.map(\n (v): IInterestRate => ({\n series_id,\n datasource_id,\n product_id,\n created_at: formatTime(+v.funding_time),\n long_rate: `${-v.funding_rate}`,\n short_rate: `${v.funding_rate}`,\n settlement_price: '',\n }),\n );\n total_page = res.data.total_page;\n current_page++;\n if (current_page >= total_page) break;\n if (+res.data.data[res.data.data.length - 1].funding_time <= started_at) break;\n await firstValueFrom(timer(1000));\n }\n }\n throw newError('UNSUPPORTED_INST_TYPE', { instType });\n },\n});\n"]}
1
+ {"version":3,"file":"interest_rate.js","sourceRoot":"","sources":["../../../src/services/market-data/interest_rate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,qDAA2D;AAC3D,+CAA4C;AAC5C,yCAAiE;AACjE,+BAA6C;AAC7C,qDAAoE;AAEpE,IAAA,kCAAoB,EAAgB,mBAAQ,CAAC,WAAW,EAAE,EAAE;IAC1D,SAAS,EAAE,eAAe;IAC1B,sBAAsB,EAAE,CAAC,KAAK,CAAC;IAC/B,QAAQ,EAAE,IAAI;IACd,cAAc,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;IAClC,OAAO,EAAE,UAAiB,EAAE,SAAS,EAAE,UAAU,EAAE;;YACjD,MAAM,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,GAAG,IAAA,kBAAU,EAAC,SAAS,CAAC,CAAC;YAE1D,IAAI,QAAQ,KAAK,MAAM,EAAE;gBACvB,IAAI,YAAY,GAAG,CAAC,CAAC;gBACrB,IAAI,UAAU,GAAG,CAAC,CAAC;gBACnB,OAAO,IAAI,EAAE;oBACX,YAAY;oBACZ,MAAM,GAAG,GAAG,cAAM,IAAA,yCAA4B,EAAC;wBAC7C,aAAa,EAAE,aAAa;wBAC5B,UAAU,EAAE,YAAY;qBACzB,CAAC,CAAA,CAAC;oBACH,IAAI,GAAG,CAAC,MAAM,KAAK,IAAI,EAAE;wBACvB,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,CAAC;qBACnC;oBACD,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;wBAAE,MAAM;oBACtC,oBAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACrB,CAAC,CAAC,EAAiB,EAAE,CAAC,CAAC;wBACrB,SAAS;wBACT,aAAa,EAAE,KAAK;wBACpB,UAAU,EAAE,SAAS;wBACrB,UAAU,EAAE,IAAA,kBAAU,EAAC,CAAC,CAAC,CAAC,YAAY,CAAC;wBACvC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,YAAY,EAAE;wBAC/B,UAAU,EAAE,GAAG,CAAC,CAAC,YAAY,EAAE;wBAC/B,gBAAgB,EAAE,EAAE;qBACrB,CAAC,CACH,CAAA,CAAC;oBACF,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;oBACjC,YAAY,EAAE,CAAC;oBACf,IAAI,YAAY,IAAI,UAAU;wBAAE,MAAM;oBACtC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,YAAY,IAAI,UAAU;wBAAE,MAAM;oBAC/E,cAAM,IAAA,qBAAc,EAAC,IAAA,YAAK,EAAC,IAAI,CAAC,CAAC,CAAA,CAAC;iBACnC;aACF;YACD,MAAM,IAAA,gBAAQ,EAAC,uBAAuB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACxD,CAAC;KAAA;CACF,CAAC,CAAC","sourcesContent":["import { IInterestRate } from '@yuants/data-interest-rate';\nimport { createSeriesProvider } from '@yuants/data-series';\nimport { Terminal } from '@yuants/protocol';\nimport { decodePath, formatTime, newError } from '@yuants/utils';\nimport { firstValueFrom, timer } from 'rxjs';\nimport { getSwapHistoricalFundingRate } from '../../api/public-api';\n\ncreateSeriesProvider<IInterestRate>(Terminal.fromNodeEnv(), {\n tableName: 'interest_rate',\n series_id_prefix_parts: ['HTX'],\n reversed: true,\n serviceOptions: { concurrent: 10 },\n queryFn: async function* ({ series_id, started_at }) {\n const [, instType, contract_code] = decodePath(series_id);\n\n if (instType === 'SWAP') {\n let current_page = 0;\n let total_page = 1;\n while (true) {\n // 向前翻页,时间降序\n const res = await getSwapHistoricalFundingRate({\n contract_code: contract_code,\n page_index: current_page,\n });\n if (res.status !== 'ok') {\n throw `API failed: ${res.status}`;\n }\n if (res.data.data.length === 0) break;\n yield res.data.data.map(\n (v): IInterestRate => ({\n series_id,\n datasource_id: 'HTX',\n product_id: series_id,\n created_at: formatTime(+v.funding_time),\n long_rate: `${-v.funding_rate}`,\n short_rate: `${v.funding_rate}`,\n settlement_price: '',\n }),\n );\n total_page = res.data.total_page;\n current_page++;\n if (current_page >= total_page) break;\n if (+res.data.data[res.data.data.length - 1].funding_time <= started_at) break;\n await firstValueFrom(timer(1000));\n }\n }\n throw newError('UNSUPPORTED_INST_TYPE', { instType });\n },\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuants/vendor-huobi",
3
- "version": "0.15.1",
3
+ "version": "0.15.3",
4
4
  "main": "lib/index.js",
5
5
  "files": [
6
6
  "dist",
@@ -8,18 +8,18 @@
8
8
  "temp"
9
9
  ],
10
10
  "dependencies": {
11
- "@yuants/protocol": "0.53.1",
12
- "@yuants/data-account": "0.8.3",
13
- "@yuants/data-order": "0.6.5",
14
- "@yuants/transfer": "0.2.38",
11
+ "@yuants/protocol": "0.53.2",
12
+ "@yuants/data-account": "0.8.4",
13
+ "@yuants/data-order": "0.6.6",
14
+ "@yuants/transfer": "0.2.39",
15
15
  "@yuants/utils": "0.14.0",
16
16
  "@yuants/cache": "0.3.3",
17
- "@yuants/sql": "0.9.29",
18
- "@yuants/data-product": "0.4.20",
19
- "@yuants/data-series": "0.3.50",
20
- "@yuants/data-interest-rate": "0.1.47",
21
- "@yuants/data-quote": "0.2.42",
22
- "@yuants/exchange": "0.1.1",
17
+ "@yuants/sql": "0.9.30",
18
+ "@yuants/data-product": "0.4.21",
19
+ "@yuants/data-series": "0.3.51",
20
+ "@yuants/data-interest-rate": "0.1.48",
21
+ "@yuants/data-quote": "0.2.43",
22
+ "@yuants/exchange": "0.1.2",
23
23
  "rxjs": "~7.5.6"
24
24
  },
25
25
  "devDependencies": {
@@ -1,13 +1,13 @@
1
1
  {
2
- "apps/vendor-huobi/CHANGELOG.json": "3daec0cf0fd40c844762016b64d25d5928c46867",
3
- "apps/vendor-huobi/CHANGELOG.md": "82c02c887f6b04c96fb4557d7babddd1c9890f43",
2
+ "apps/vendor-huobi/CHANGELOG.json": "62f13640a80624162246d8d02f1f42f381feede8",
3
+ "apps/vendor-huobi/CHANGELOG.md": "bc69e0f7772cc3dddc4052e92ecf211c99ecfa8f",
4
4
  "apps/vendor-huobi/README.md": "d7bf0149513114eab5500a6b5c9e7cba10565572",
5
5
  "apps/vendor-huobi/api-extractor.json": "62f4fd324425b9a235f0c117975967aab09ced0c",
6
6
  "apps/vendor-huobi/config/jest.config.json": "4bb17bde3ee911163a3edb36a6eb71491d80b1bd",
7
7
  "apps/vendor-huobi/config/rig.json": "f6c7b5537dc77a3170ba9f008bae3b6c3ee11956",
8
8
  "apps/vendor-huobi/config/typescript.json": "854907e8a821f2050f6533368db160c649c25348",
9
9
  "apps/vendor-huobi/etc/vendor-huobi.api.md": "dc8cbf2a044a227b30a4ee9701b0c97328244724",
10
- "apps/vendor-huobi/package.json": "9786f8a1de6f113a25250ebd95e20738d0c67796",
10
+ "apps/vendor-huobi/package.json": "d8d561f0368cbd4a1c09a990ac4ac4ec5999ff80",
11
11
  "apps/vendor-huobi/src/__archived/account-info.ts": "5c325d3bb8839476c11f25693326ce05f3321ebd",
12
12
  "apps/vendor-huobi/src/__archived/api.ts": "8366151dc881b177d0478fb328a601a11e33cd35",
13
13
  "apps/vendor-huobi/src/__archived/transfer.ts": "fd299ad82ff31344460967f2a938b8f36c879259",
@@ -18,7 +18,7 @@
18
18
  "apps/vendor-huobi/src/services/accounts/super-margin.ts": "b4fbe80f4d1419a211a03461bbe7c96ad52aa594",
19
19
  "apps/vendor-huobi/src/services/accounts/swap.ts": "4da1dbf2cc3554a9943df419c5a11330130a5f3d",
20
20
  "apps/vendor-huobi/src/services/exchange.ts": "6fed94206a22c43d3c6890cf52ff054a24d98d82",
21
- "apps/vendor-huobi/src/services/market-data/interest_rate.ts": "8c737154003cc55568cdc3288004b720082be258",
21
+ "apps/vendor-huobi/src/services/market-data/interest_rate.ts": "79aa362f9fa90e612f9813d0b45d357b96189f3e",
22
22
  "apps/vendor-huobi/src/services/market-data/quote.ts": "d11620707dd195403df11320cccff7f481b4ae9c",
23
23
  "apps/vendor-huobi/src/services/orders/listOrders.ts": "1cf4621727fb290f8e5fd1439765fd73387bda7a",
24
24
  "apps/vendor-huobi/src/services/orders/submitOrder.ts": "e79925ede5f4a7dc856f5662ebe9dfb3b9dc8a01",
@@ -26,18 +26,18 @@
26
26
  "apps/vendor-huobi/src/services/uid.ts": "b71c27a6a0debdd9365dea35306f4763327aca2f",
27
27
  "apps/vendor-huobi/tsconfig.json": "81da8f78196974b5d15da0edb6b2d9f48641063c",
28
28
  "apps/vendor-huobi/.rush/temp/shrinkwrap-deps.json": "3099afcf246e8bc9ff02db11dd7b34b8bd1e72d9",
29
- "libraries/protocol/temp/package-deps.json": "14095036ed251977cb3fb362a7e23d8786aaa4c9",
30
- "libraries/data-account/temp/package-deps.json": "eb3d9ccad211a998fef9e0230e164407bf1b95fc",
31
- "libraries/data-order/temp/package-deps.json": "cf5b85fc4c5160f51023f7fbdc68a7ed9db5573a",
32
- "libraries/transfer/temp/package-deps.json": "0be7967706065779def1ef1e7f68a9794690599a",
29
+ "libraries/protocol/temp/package-deps.json": "0bd43721e96039b52d7b59c834dc6df45cf75e3f",
30
+ "libraries/data-account/temp/package-deps.json": "ae6b0c69040d0d1989525e843717b6e303d95ef2",
31
+ "libraries/data-order/temp/package-deps.json": "2adac9fc0423f9b1b7ddaa8946ab7af374cc22e1",
32
+ "libraries/transfer/temp/package-deps.json": "36c58299bd6c841c5ba7252d71881a881570d08c",
33
33
  "libraries/utils/temp/package-deps.json": "6d58e9b325e8d16de8a878c32010f626b12a01da",
34
34
  "libraries/cache/temp/package-deps.json": "a4afa15e6462983f9d3735d31dc1ed8a683fb4dc",
35
- "libraries/sql/temp/package-deps.json": "95cd7209bf6002d530eb37960bac77c793afadd0",
36
- "libraries/data-product/temp/package-deps.json": "60b8abf6f95edc29268f10f0d64331e2f034a3e5",
37
- "libraries/data-series/temp/package-deps.json": "d70ec6d1ca7342204a35a1c3619481e226239e73",
38
- "libraries/data-interest-rate/temp/package-deps.json": "92396227ed3aab2f407bf93c515cf340ac796932",
39
- "libraries/data-quote/temp/package-deps.json": "5a46a556f6eb8f2c682b092ee4703207e226ea8a",
40
- "libraries/exchange/temp/package-deps.json": "68091305dec4ea0dc245f4314f1d474a2c3247d8",
35
+ "libraries/sql/temp/package-deps.json": "4a9a7ec55f04b20459e664e81e76fa74b6c77b39",
36
+ "libraries/data-product/temp/package-deps.json": "8caccae65af24afde5d0e602eb24f57c22c7efd2",
37
+ "libraries/data-series/temp/package-deps.json": "c89ebffe302757903aa54eff78f76cb855486b8c",
38
+ "libraries/data-interest-rate/temp/package-deps.json": "cef1e1cb0116ad593c24635684e0cbf03488d67c",
39
+ "libraries/data-quote/temp/package-deps.json": "34d079eab44d2bf65e07b112ac2099c6e92a015e",
40
+ "libraries/exchange/temp/package-deps.json": "f9a2557b53874e78a809b82326b850d98b524a9b",
41
41
  "libraries/extension/temp/package-deps.json": "9569c553c2f9a7d50b70d8f101fc2d3825aaccb9",
42
42
  "tools/toolkit/temp/package-deps.json": "23e053490eb8feade23e4d45de4e54883e322711"
43
43
  }