@yuants/vendor-okx 0.33.12 → 0.33.13
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/dist/experimental/exchange.js +3 -2
- package/dist/experimental/exchange.js.map +1 -1
- package/lib/experimental/exchange.js +2 -1
- package/lib/experimental/exchange.js.map +1 -1
- package/package.json +6 -6
- package/temp/build/typescript/ts_xKrCYDcc.json +1 -1
- package/temp/package-deps.json +5 -5
- package/temp/test/jest/haste-map-0104fb5fee08bd97aacd02300cdbf195-f3ddf881f4f21e2e5ae6006d95adf2b1-267deb988b5111321a1cf92c4d020334 +0 -0
- package/temp/test/jest/perf-cache-0104fb5fee08bd97aacd02300cdbf195-da39a3ee5e6b4b0d3255bfef95601890 +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { provideExchangeServices } from '@yuants/exchange';
|
|
2
2
|
import { Terminal } from '@yuants/protocol';
|
|
3
|
-
import { encodePath, newError } from '@yuants/utils';
|
|
3
|
+
import { decodePath, encodePath, newError } from '@yuants/utils';
|
|
4
4
|
import { getAccountConfig } from '../api/private-api';
|
|
5
5
|
import { cancelOrder } from '../orders/cancelOrder';
|
|
6
6
|
import { modifyOrder } from '../orders/modifyOrder';
|
|
@@ -45,7 +45,8 @@ provideExchangeServices(terminal, {
|
|
|
45
45
|
if (!product_id || !order_id) {
|
|
46
46
|
throw newError('OKX_GET_ORDER_BY_ID_MISSING_PARAMS', { params });
|
|
47
47
|
}
|
|
48
|
-
const
|
|
48
|
+
const [_, __, instId] = decodePath(product_id);
|
|
49
|
+
const order = await getTradeOrderDetail(credential, instId, order_id);
|
|
49
50
|
return order;
|
|
50
51
|
},
|
|
51
52
|
submitOrder: submitOrder,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../src/experimental/exchange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AA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AAM,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QACtE,OAAO,KAAK,CAAC;IACf,CAAC;IACD,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,WAAW;CACzB,CAAC,CAAC","sourcesContent":["import { provideExchangeServices } from '@yuants/exchange';\nimport { Terminal } from '@yuants/protocol';\nimport { decodePath, encodePath, newError } from '@yuants/utils';\nimport { getAccountConfig, ICredential } from '../api/private-api';\nimport { cancelOrder } from '../orders/cancelOrder';\nimport { modifyOrder } from '../orders/modifyOrder';\nimport { submitOrder } from '../orders/submitOrder';\nimport { getOrders } from './getOrders';\nimport { getPositions } from './getPositions';\nimport { listProducts } from './product';\nimport { getTradeOrderDetail } from './getOrderDetail';\n\nconst terminal = Terminal.fromNodeEnv();\n\nprovideExchangeServices<ICredential>(terminal, {\n name: 'OKX',\n credentialSchema: {\n type: 'object',\n required: ['access_key', 'secret_key', 'passphrase'],\n properties: {\n access_key: { type: 'string' },\n secret_key: { type: 'string' },\n passphrase: { type: 'string' },\n },\n },\n getCredentialId: async function (credential: ICredential): Promise<string> {\n const res = await getAccountConfig(credential);\n const uid = res.data?.[0]?.uid;\n if (!uid) throw newError('OKX_CREDENTIAL_INVALID', { res });\n return encodePath('OKX', uid);\n },\n listProducts: listProducts,\n getPositions: getPositions,\n getOrders,\n getPositionsByProductId: async (credential, product_id) => {\n const positions = await getPositions(credential);\n return positions.filter((x) => x.product_id === product_id);\n },\n getOrdersByProductId: async (credential, product_id) => {\n const orders = await getOrders(credential);\n return orders.filter((x) => x.product_id === product_id);\n },\n getOrderByOrderId: async (credential, params) => {\n const { product_id, order_id } = params as { product_id: string; order_id: string };\n if (!product_id || !order_id) {\n throw newError('OKX_GET_ORDER_BY_ID_MISSING_PARAMS', { params });\n }\n const [_, __, instId] = decodePath(product_id);\n const order = await getTradeOrderDetail(credential, instId, order_id);\n return order;\n },\n submitOrder: submitOrder,\n modifyOrder: modifyOrder,\n cancelOrder: cancelOrder,\n});\n"]}
|
|
@@ -47,7 +47,8 @@ const terminal = protocol_1.Terminal.fromNodeEnv();
|
|
|
47
47
|
if (!product_id || !order_id) {
|
|
48
48
|
throw (0, utils_1.newError)('OKX_GET_ORDER_BY_ID_MISSING_PARAMS', { params });
|
|
49
49
|
}
|
|
50
|
-
const
|
|
50
|
+
const [_, __, instId] = (0, utils_1.decodePath)(product_id);
|
|
51
|
+
const order = await (0, getOrderDetail_1.getTradeOrderDetail)(credential, instId, order_id);
|
|
51
52
|
return order;
|
|
52
53
|
},
|
|
53
54
|
submitOrder: submitOrder_1.submitOrder,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../src/experimental/exchange.ts"],"names":[],"mappings":";;AAAA,+CAA2D;AAC3D,+CAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../src/experimental/exchange.ts"],"names":[],"mappings":";;AAAA,+CAA2D;AAC3D,+CAA4C;AAC5C,yCAAiE;AACjE,oDAAmE;AACnE,uDAAoD;AACpD,uDAAoD;AACpD,uDAAoD;AACpD,2CAAwC;AACxC,iDAA8C;AAC9C,uCAAyC;AACzC,qDAAuD;AAEvD,MAAM,QAAQ,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC;AAExC,IAAA,kCAAuB,EAAc,QAAQ,EAAE;IAC7C,IAAI,EAAE,KAAK;IACX,gBAAgB,EAAE;QAChB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC;QACpD,UAAU,EAAE;YACV,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC9B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC9B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC/B;KACF;IACD,eAAe,EAAE,KAAK,WAAW,UAAuB;;QACtD,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AC,GAAG,IAAA,kBAAU,EAAC,UAAU,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,MAAM,IAAA,oCAAmB,EAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QACtE,OAAO,KAAK,CAAC;IACf,CAAC;IACD,WAAW,EAAE,yBAAW;IACxB,WAAW,EAAE,yBAAW;IACxB,WAAW,EAAE,yBAAW;CACzB,CAAC,CAAC","sourcesContent":["import { provideExchangeServices } from '@yuants/exchange';\nimport { Terminal } from '@yuants/protocol';\nimport { decodePath, encodePath, newError } from '@yuants/utils';\nimport { getAccountConfig, ICredential } from '../api/private-api';\nimport { cancelOrder } from '../orders/cancelOrder';\nimport { modifyOrder } from '../orders/modifyOrder';\nimport { submitOrder } from '../orders/submitOrder';\nimport { getOrders } from './getOrders';\nimport { getPositions } from './getPositions';\nimport { listProducts } from './product';\nimport { getTradeOrderDetail } from './getOrderDetail';\n\nconst terminal = Terminal.fromNodeEnv();\n\nprovideExchangeServices<ICredential>(terminal, {\n name: 'OKX',\n credentialSchema: {\n type: 'object',\n required: ['access_key', 'secret_key', 'passphrase'],\n properties: {\n access_key: { type: 'string' },\n secret_key: { type: 'string' },\n passphrase: { type: 'string' },\n },\n },\n getCredentialId: async function (credential: ICredential): Promise<string> {\n const res = await getAccountConfig(credential);\n const uid = res.data?.[0]?.uid;\n if (!uid) throw newError('OKX_CREDENTIAL_INVALID', { res });\n return encodePath('OKX', uid);\n },\n listProducts: listProducts,\n getPositions: getPositions,\n getOrders,\n getPositionsByProductId: async (credential, product_id) => {\n const positions = await getPositions(credential);\n return positions.filter((x) => x.product_id === product_id);\n },\n getOrdersByProductId: async (credential, product_id) => {\n const orders = await getOrders(credential);\n return orders.filter((x) => x.product_id === product_id);\n },\n getOrderByOrderId: async (credential, params) => {\n const { product_id, order_id } = params as { product_id: string; order_id: string };\n if (!product_id || !order_id) {\n throw newError('OKX_GET_ORDER_BY_ID_MISSING_PARAMS', { params });\n }\n const [_, __, instId] = decodePath(product_id);\n const order = await getTradeOrderDetail(credential, instId, order_id);\n return order;\n },\n submitOrder: submitOrder,\n modifyOrder: modifyOrder,\n cancelOrder: cancelOrder,\n});\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuants/vendor-okx",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.13",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -12,19 +12,19 @@
|
|
|
12
12
|
"ws": "~8.8.1",
|
|
13
13
|
"@yuants/protocol": "0.55.0",
|
|
14
14
|
"@yuants/transfer": "0.2.52",
|
|
15
|
+
"@yuants/data-account": "0.11.12",
|
|
15
16
|
"@yuants/data-order": "0.7.13",
|
|
16
17
|
"@yuants/utils": "0.19.7",
|
|
17
|
-
"@yuants/data-account": "0.11.12",
|
|
18
18
|
"@yuants/http-services": "0.5.3",
|
|
19
19
|
"@yuants/cache": "0.3.15",
|
|
20
|
-
"@yuants/sql": "0.9.43",
|
|
21
20
|
"@yuants/data-series": "0.3.65",
|
|
21
|
+
"@yuants/sql": "0.9.43",
|
|
22
22
|
"@yuants/data-product": "0.5.13",
|
|
23
|
-
"@yuants/data-interest-rate": "0.2.13",
|
|
24
23
|
"@yuants/data-ohlc": "0.6.8",
|
|
25
|
-
"@yuants/data-
|
|
24
|
+
"@yuants/data-interest-rate": "0.2.13",
|
|
26
25
|
"@yuants/data-quote": "0.4.12",
|
|
27
|
-
"@yuants/exchange": "0.8.
|
|
26
|
+
"@yuants/exchange": "0.8.25",
|
|
27
|
+
"@yuants/data-trade": "0.1.38"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@microsoft/api-extractor": "~7.55.2",
|