@yuants/vendor-okx 0.19.0 → 0.19.2

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/index.js CHANGED
@@ -4,4 +4,5 @@ import './ohlc';
4
4
  import './quote';
5
5
  import './account';
6
6
  import './order';
7
+ import './trade';
7
8
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,CAAC;AACxB,OAAO,QAAQ,CAAC;AAChB,OAAO,SAAS,CAAC;AACjB,OAAO,WAAW,CAAC;AACnB,OAAO,SAAS,CAAC","sourcesContent":["import './interest_rate';\nimport './legacy_index';\nimport './ohlc';\nimport './quote';\nimport './account';\nimport './order';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,CAAC;AACxB,OAAO,QAAQ,CAAC;AAChB,OAAO,SAAS,CAAC;AACjB,OAAO,WAAW,CAAC;AACnB,OAAO,SAAS,CAAC;AACjB,OAAO,SAAS,CAAC","sourcesContent":["import './interest_rate';\nimport './legacy_index';\nimport './ohlc';\nimport './quote';\nimport './account';\nimport './order';\nimport './trade';\n"]}
package/dist/trade.js ADDED
@@ -0,0 +1,119 @@
1
+ import { catchError, defer, first, of, repeat, retry, timeout } from 'rxjs';
2
+ import { client } from './api';
3
+ import { accountUid$ } from './account';
4
+ import { formatTime } from '@yuants/utils';
5
+ import { buildInsertManyIntoTableSQL, escapeSQL, requestSQL } from '@yuants/sql';
6
+ import { Terminal } from '@yuants/protocol';
7
+ const tradeParser = async (accountId, params) => {
8
+ const tradeList = [];
9
+ const result = await client.getAccountBillsArchive(params);
10
+ if (result.code === '0' && result.data) {
11
+ const data = result.data;
12
+ const mapTradeIdToBillList = new Map();
13
+ data.forEach((item) => { var _a; return mapTradeIdToBillList.set(item.tradeId, [...((_a = mapTradeIdToBillList.get(item.tradeId)) !== null && _a !== void 0 ? _a : []), item]); });
14
+ mapTradeIdToBillList.forEach((v, tradeId) => {
15
+ if (!((v[0].instType === 'SPOT' && v.length === 2) || v[0].instType === 'SWAP'))
16
+ return;
17
+ const trade = {
18
+ id: tradeId,
19
+ account_id: accountId,
20
+ product_id: '',
21
+ direction: '',
22
+ traded_volume: '',
23
+ traded_price: '',
24
+ traded_value: '',
25
+ fee: '',
26
+ fee_currency: '',
27
+ created_at: '0',
28
+ };
29
+ v.forEach((bill) => {
30
+ trade.created_at = Math.max(Number(trade.created_at), Number(bill.ts)).toString();
31
+ trade.product_id = bill.instId;
32
+ trade.traded_price = bill.px;
33
+ if (bill.instType === 'SWAP') {
34
+ if (bill.subType === '3')
35
+ trade.direction = 'OPEN_LONG';
36
+ if (bill.subType === '4')
37
+ trade.direction = 'OPEN_SHORT';
38
+ if (bill.subType === '5')
39
+ trade.direction = 'CLOSE_LONG';
40
+ if (bill.subType === '6')
41
+ trade.direction = 'CLOSE_SHORT';
42
+ trade.traded_volume = bill.sz;
43
+ trade.traded_value = (Number(bill.sz) * Number(bill.px)).toString();
44
+ }
45
+ if (bill.instType === 'SPOT') {
46
+ if (bill.subType === '1') {
47
+ if (bill.ccy !== 'USDT') {
48
+ trade.direction = 'OPEN_LONG';
49
+ }
50
+ else {
51
+ trade.direction = 'CLOSE_LONG';
52
+ }
53
+ }
54
+ if (bill.ccy !== 'USDT') {
55
+ trade.traded_volume = bill.sz;
56
+ }
57
+ if (bill.ccy === 'USDT') {
58
+ trade.traded_value = bill.sz;
59
+ }
60
+ }
61
+ // fee
62
+ if (bill.fee !== '0') {
63
+ trade.fee = Math.abs(Number(bill.fee)).toString();
64
+ trade.fee_currency = bill.ccy;
65
+ }
66
+ });
67
+ trade.created_at = formatTime(Number(trade.created_at));
68
+ tradeList.push(trade);
69
+ });
70
+ }
71
+ return tradeList;
72
+ };
73
+ const getAccountTradeWithAccountId = async (accountId) => {
74
+ var _a;
75
+ const currentTrade = await requestSQL(Terminal.fromNodeEnv(), `
76
+ select * from trade where account_id=${escapeSQL(accountId)} order by created_at desc limit 1;
77
+ `);
78
+ const params = {
79
+ type: '2',
80
+ };
81
+ if (currentTrade.length === 1) {
82
+ params['begin'] = new Date((_a = currentTrade[0].created_at) !== null && _a !== void 0 ? _a : 0).getTime().toString();
83
+ params['end'] = Date.now().toString();
84
+ }
85
+ console.log(formatTime(Date.now()), 'getAccountTrade', `params: ${JSON.stringify(params)}`);
86
+ const tradeList = await tradeParser(accountId, params);
87
+ console.log(formatTime(Date.now()), 'getAccountTrade', `tradeList: ${JSON.stringify(tradeList)}`);
88
+ await requestSQL(Terminal.fromNodeEnv(), buildInsertManyIntoTableSQL(tradeList, 'trade', {
89
+ columns: [
90
+ 'id',
91
+ 'account_id',
92
+ 'product_id',
93
+ 'traded_volume',
94
+ 'traded_value',
95
+ 'traded_price',
96
+ 'direction',
97
+ 'fee',
98
+ 'fee_currency',
99
+ 'created_at',
100
+ ],
101
+ conflictKeys: ['id'],
102
+ }));
103
+ };
104
+ defer(() => accountUid$)
105
+ .pipe(first())
106
+ .subscribe((uid) => {
107
+ const account_id = `okx/${uid}/trading`;
108
+ console.log(formatTime(Date.now()), 'getAccountTrade', `AccountID: ${account_id}`);
109
+ defer(() => getAccountTradeWithAccountId(account_id))
110
+ .pipe(
111
+ //
112
+ repeat({ delay: 30000 }), retry({ delay: 5000 }), timeout(10000), // 超时设定:10 秒
113
+ catchError((err) => {
114
+ console.error(formatTime(Date.now()), 'getAccountTradeError', err);
115
+ return of([]);
116
+ }))
117
+ .subscribe();
118
+ });
119
+ //# sourceMappingURL=trade.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trade.js","sourceRoot":"","sources":["../src/trade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAA4B,EA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AAC;IACnF,KAAK,CAAC,GAAG,EAAE,CAAC,4BAA4B,CAAC,UAAU,CAAC,CAAC;SAClD,IAAI;IACH,EAAE;IACF,MAAM,CAAC,EAAE,KAAK,EAAE,KAAM,EAAE,CAAC,EACzB,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EACtB,OAAO,CAAC,KAAM,CAAC,EAAE,aAAa;IAC9B,UAAU,CAAC,CAAC,GAAG,EAAE,EAAE;QACjB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,sBAAsB,EAAE,GAAG,CAAC,CAAC;QACnE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;IAChB,CAAC,CAAC,CACH;SACA,SAAS,EAAE,CAAC;AACjB,CAAC,CAAC,CAAC","sourcesContent":["import { catchError, defer, first, firstValueFrom, interval, of, repeat, retry, timeout } from 'rxjs';\nimport { client } from './api';\nimport { ITrade } from '@yuants/data-trade';\nimport { accountUid$ } from './account';\nimport { formatTime } from '@yuants/utils';\nimport { buildInsertManyIntoTableSQL, escapeSQL, requestSQL } from '@yuants/sql';\nimport { Terminal } from '@yuants/protocol';\nconst tradeParser = async (accountId: string, params: Record<string, string>): Promise<ITrade[]> => {\n const tradeList: ITrade[] = [];\n const result = await client.getAccountBillsArchive(params);\n\n if (result.code === '0' && result.data) {\n const data = result.data;\n const mapTradeIdToBillList = new Map<string, typeof data>();\n data.forEach((item) =>\n mapTradeIdToBillList.set(item.tradeId, [...(mapTradeIdToBillList.get(item.tradeId) ?? []), item]),\n );\n mapTradeIdToBillList.forEach((v, tradeId) => {\n if (!((v[0].instType === 'SPOT' && v.length === 2) || v[0].instType === 'SWAP')) return;\n\n const trade: ITrade = {\n id: tradeId,\n account_id: accountId,\n product_id: '',\n direction: '',\n traded_volume: '',\n traded_price: '',\n traded_value: '',\n fee: '',\n fee_currency: '',\n created_at: '0',\n };\n\n v.forEach((bill) => {\n trade.created_at = Math.max(Number(trade.created_at), Number(bill.ts)).toString();\n trade.product_id = bill.instId;\n trade.traded_price = bill.px;\n if (bill.instType === 'SWAP') {\n if (bill.subType === '3') trade.direction = 'OPEN_LONG';\n if (bill.subType === '4') trade.direction = 'OPEN_SHORT';\n if (bill.subType === '5') trade.direction = 'CLOSE_LONG';\n if (bill.subType === '6') trade.direction = 'CLOSE_SHORT';\n trade.traded_volume = bill.sz;\n trade.traded_value = (Number(bill.sz) * Number(bill.px)).toString();\n }\n if (bill.instType === 'SPOT') {\n if (bill.subType === '1') {\n if (bill.ccy !== 'USDT') {\n trade.direction = 'OPEN_LONG';\n } else {\n trade.direction = 'CLOSE_LONG';\n }\n }\n\n if (bill.ccy !== 'USDT') {\n trade.traded_volume = bill.sz;\n }\n if (bill.ccy === 'USDT') {\n trade.traded_value = bill.sz;\n }\n }\n // fee\n if (bill.fee !== '0') {\n trade.fee = Math.abs(Number(bill.fee)).toString();\n trade.fee_currency = bill.ccy;\n }\n });\n trade.created_at = formatTime(Number(trade.created_at));\n tradeList.push(trade);\n });\n }\n return tradeList;\n};\n\nconst getAccountTradeWithAccountId = async (accountId: string) => {\n const currentTrade = await requestSQL<ITrade[]>(\n Terminal.fromNodeEnv(),\n `\n select * from trade where account_id=${escapeSQL(accountId)} order by created_at desc limit 1;\n `,\n );\n const params: Record<string, string> = {\n type: '2',\n };\n if (currentTrade.length === 1) {\n params['begin'] = new Date(currentTrade[0].created_at ?? 0).getTime().toString();\n params['end'] = Date.now().toString();\n }\n console.log(formatTime(Date.now()), 'getAccountTrade', `params: ${JSON.stringify(params)}`);\n const tradeList = await tradeParser(accountId, params);\n console.log(formatTime(Date.now()), 'getAccountTrade', `tradeList: ${JSON.stringify(tradeList)}`);\n await requestSQL(\n Terminal.fromNodeEnv(),\n buildInsertManyIntoTableSQL(tradeList, 'trade', {\n columns: [\n 'id',\n 'account_id',\n 'product_id',\n 'traded_volume',\n 'traded_value',\n 'traded_price',\n 'direction',\n 'fee',\n 'fee_currency',\n 'created_at',\n ],\n conflictKeys: ['id'],\n }),\n );\n};\n\ndefer(() => accountUid$)\n .pipe(first())\n .subscribe((uid) => {\n const account_id = `okx/${uid}/trading`;\n console.log(formatTime(Date.now()), 'getAccountTrade', `AccountID: ${account_id}`);\n defer(() => getAccountTradeWithAccountId(account_id))\n .pipe(\n //\n repeat({ delay: 30_000 }),\n retry({ delay: 5000 }),\n timeout(10_000), // 超时设定:10 秒\n catchError((err) => {\n console.error(formatTime(Date.now()), 'getAccountTradeError', err);\n return of([]);\n }),\n )\n .subscribe();\n });\n"]}
package/lib/index.d.ts CHANGED
@@ -4,4 +4,5 @@ import './ohlc';
4
4
  import './quote';
5
5
  import './account';
6
6
  import './order';
7
+ import './trade';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,CAAC;AACxB,OAAO,QAAQ,CAAC;AAChB,OAAO,SAAS,CAAC;AACjB,OAAO,WAAW,CAAC;AACnB,OAAO,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,CAAC;AACxB,OAAO,QAAQ,CAAC;AAChB,OAAO,SAAS,CAAC;AACjB,OAAO,WAAW,CAAC;AACnB,OAAO,SAAS,CAAC;AACjB,OAAO,SAAS,CAAC"}
package/lib/index.js CHANGED
@@ -6,4 +6,5 @@ require("./ohlc");
6
6
  require("./quote");
7
7
  require("./account");
8
8
  require("./order");
9
+ require("./trade");
9
10
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,2BAAyB;AACzB,0BAAwB;AACxB,kBAAgB;AAChB,mBAAiB;AACjB,qBAAmB;AACnB,mBAAiB","sourcesContent":["import './interest_rate';\nimport './legacy_index';\nimport './ohlc';\nimport './quote';\nimport './account';\nimport './order';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,2BAAyB;AACzB,0BAAwB;AACxB,kBAAgB;AAChB,mBAAiB;AACjB,qBAAmB;AACnB,mBAAiB;AACjB,mBAAiB","sourcesContent":["import './interest_rate';\nimport './legacy_index';\nimport './ohlc';\nimport './quote';\nimport './account';\nimport './order';\nimport './trade';\n"]}
package/lib/trade.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=trade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trade.d.ts","sourceRoot":"","sources":["../src/trade.ts"],"names":[],"mappings":""}
package/lib/trade.js ADDED
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const rxjs_1 = require("rxjs");
4
+ const api_1 = require("./api");
5
+ const account_1 = require("./account");
6
+ const utils_1 = require("@yuants/utils");
7
+ const sql_1 = require("@yuants/sql");
8
+ const protocol_1 = require("@yuants/protocol");
9
+ const tradeParser = async (accountId, params) => {
10
+ const tradeList = [];
11
+ const result = await api_1.client.getAccountBillsArchive(params);
12
+ if (result.code === '0' && result.data) {
13
+ const data = result.data;
14
+ const mapTradeIdToBillList = new Map();
15
+ data.forEach((item) => { var _a; return mapTradeIdToBillList.set(item.tradeId, [...((_a = mapTradeIdToBillList.get(item.tradeId)) !== null && _a !== void 0 ? _a : []), item]); });
16
+ mapTradeIdToBillList.forEach((v, tradeId) => {
17
+ if (!((v[0].instType === 'SPOT' && v.length === 2) || v[0].instType === 'SWAP'))
18
+ return;
19
+ const trade = {
20
+ id: tradeId,
21
+ account_id: accountId,
22
+ product_id: '',
23
+ direction: '',
24
+ traded_volume: '',
25
+ traded_price: '',
26
+ traded_value: '',
27
+ fee: '',
28
+ fee_currency: '',
29
+ created_at: '0',
30
+ };
31
+ v.forEach((bill) => {
32
+ trade.created_at = Math.max(Number(trade.created_at), Number(bill.ts)).toString();
33
+ trade.product_id = bill.instId;
34
+ trade.traded_price = bill.px;
35
+ if (bill.instType === 'SWAP') {
36
+ if (bill.subType === '3')
37
+ trade.direction = 'OPEN_LONG';
38
+ if (bill.subType === '4')
39
+ trade.direction = 'OPEN_SHORT';
40
+ if (bill.subType === '5')
41
+ trade.direction = 'CLOSE_LONG';
42
+ if (bill.subType === '6')
43
+ trade.direction = 'CLOSE_SHORT';
44
+ trade.traded_volume = bill.sz;
45
+ trade.traded_value = (Number(bill.sz) * Number(bill.px)).toString();
46
+ }
47
+ if (bill.instType === 'SPOT') {
48
+ if (bill.subType === '1') {
49
+ if (bill.ccy !== 'USDT') {
50
+ trade.direction = 'OPEN_LONG';
51
+ }
52
+ else {
53
+ trade.direction = 'CLOSE_LONG';
54
+ }
55
+ }
56
+ if (bill.ccy !== 'USDT') {
57
+ trade.traded_volume = bill.sz;
58
+ }
59
+ if (bill.ccy === 'USDT') {
60
+ trade.traded_value = bill.sz;
61
+ }
62
+ }
63
+ // fee
64
+ if (bill.fee !== '0') {
65
+ trade.fee = Math.abs(Number(bill.fee)).toString();
66
+ trade.fee_currency = bill.ccy;
67
+ }
68
+ });
69
+ trade.created_at = (0, utils_1.formatTime)(Number(trade.created_at));
70
+ tradeList.push(trade);
71
+ });
72
+ }
73
+ return tradeList;
74
+ };
75
+ const getAccountTradeWithAccountId = async (accountId) => {
76
+ var _a;
77
+ const currentTrade = await (0, sql_1.requestSQL)(protocol_1.Terminal.fromNodeEnv(), `
78
+ select * from trade where account_id=${(0, sql_1.escapeSQL)(accountId)} order by created_at desc limit 1;
79
+ `);
80
+ const params = {
81
+ type: '2',
82
+ };
83
+ if (currentTrade.length === 1) {
84
+ params['begin'] = new Date((_a = currentTrade[0].created_at) !== null && _a !== void 0 ? _a : 0).getTime().toString();
85
+ params['end'] = Date.now().toString();
86
+ }
87
+ console.log((0, utils_1.formatTime)(Date.now()), 'getAccountTrade', `params: ${JSON.stringify(params)}`);
88
+ const tradeList = await tradeParser(accountId, params);
89
+ console.log((0, utils_1.formatTime)(Date.now()), 'getAccountTrade', `tradeList: ${JSON.stringify(tradeList)}`);
90
+ await (0, sql_1.requestSQL)(protocol_1.Terminal.fromNodeEnv(), (0, sql_1.buildInsertManyIntoTableSQL)(tradeList, 'trade', {
91
+ columns: [
92
+ 'id',
93
+ 'account_id',
94
+ 'product_id',
95
+ 'traded_volume',
96
+ 'traded_value',
97
+ 'traded_price',
98
+ 'direction',
99
+ 'fee',
100
+ 'fee_currency',
101
+ 'created_at',
102
+ ],
103
+ conflictKeys: ['id'],
104
+ }));
105
+ };
106
+ (0, rxjs_1.defer)(() => account_1.accountUid$)
107
+ .pipe((0, rxjs_1.first)())
108
+ .subscribe((uid) => {
109
+ const account_id = `okx/${uid}/trading`;
110
+ console.log((0, utils_1.formatTime)(Date.now()), 'getAccountTrade', `AccountID: ${account_id}`);
111
+ (0, rxjs_1.defer)(() => getAccountTradeWithAccountId(account_id))
112
+ .pipe(
113
+ //
114
+ (0, rxjs_1.repeat)({ delay: 30000 }), (0, rxjs_1.retry)({ delay: 5000 }), (0, rxjs_1.timeout)(10000), // 超时设定:10 秒
115
+ (0, rxjs_1.catchError)((err) => {
116
+ console.error((0, utils_1.formatTime)(Date.now()), 'getAccountTradeError', err);
117
+ return (0, rxjs_1.of)([]);
118
+ }))
119
+ .subscribe();
120
+ });
121
+ //# sourceMappingURL=trade.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trade.js","sourceRoot":"","sources":["../src/trade.ts"],"names":[],"mappings":";;AAAA,+BAAsG;AACtG,+BAA+B;AAE/B,uCAAwC;AACxC,yCAA2C;AAC3C,qCAAiF;AACjF,+CAA4C;AAC5C,MAAM,WAAW,GAAG,KAAK,EAAE,SAAiB,EAAE,MAA8B,EAAqB,EAAE;IACjG,MAAM,SAAS,GAAa,EAAE,CAAC;I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,CAAC,GAAG,EAAE,CAAC,EAAE,sBAAsB,EAAE,GAAG,CAAC,CAAC;QACnE,OAAO,IAAA,SAAE,EAAC,EAAE,CAAC,CAAC;IAChB,CAAC,CAAC,CACH;SACA,SAAS,EAAE,CAAC;AACjB,CAAC,CAAC,CAAC","sourcesContent":["import { catchError, defer, first, firstValueFrom, interval, of, repeat, retry, timeout } from 'rxjs';\nimport { client } from './api';\nimport { ITrade } from '@yuants/data-trade';\nimport { accountUid$ } from './account';\nimport { formatTime } from '@yuants/utils';\nimport { buildInsertManyIntoTableSQL, escapeSQL, requestSQL } from '@yuants/sql';\nimport { Terminal } from '@yuants/protocol';\nconst tradeParser = async (accountId: string, params: Record<string, string>): Promise<ITrade[]> => {\n const tradeList: ITrade[] = [];\n const result = await client.getAccountBillsArchive(params);\n\n if (result.code === '0' && result.data) {\n const data = result.data;\n const mapTradeIdToBillList = new Map<string, typeof data>();\n data.forEach((item) =>\n mapTradeIdToBillList.set(item.tradeId, [...(mapTradeIdToBillList.get(item.tradeId) ?? []), item]),\n );\n mapTradeIdToBillList.forEach((v, tradeId) => {\n if (!((v[0].instType === 'SPOT' && v.length === 2) || v[0].instType === 'SWAP')) return;\n\n const trade: ITrade = {\n id: tradeId,\n account_id: accountId,\n product_id: '',\n direction: '',\n traded_volume: '',\n traded_price: '',\n traded_value: '',\n fee: '',\n fee_currency: '',\n created_at: '0',\n };\n\n v.forEach((bill) => {\n trade.created_at = Math.max(Number(trade.created_at), Number(bill.ts)).toString();\n trade.product_id = bill.instId;\n trade.traded_price = bill.px;\n if (bill.instType === 'SWAP') {\n if (bill.subType === '3') trade.direction = 'OPEN_LONG';\n if (bill.subType === '4') trade.direction = 'OPEN_SHORT';\n if (bill.subType === '5') trade.direction = 'CLOSE_LONG';\n if (bill.subType === '6') trade.direction = 'CLOSE_SHORT';\n trade.traded_volume = bill.sz;\n trade.traded_value = (Number(bill.sz) * Number(bill.px)).toString();\n }\n if (bill.instType === 'SPOT') {\n if (bill.subType === '1') {\n if (bill.ccy !== 'USDT') {\n trade.direction = 'OPEN_LONG';\n } else {\n trade.direction = 'CLOSE_LONG';\n }\n }\n\n if (bill.ccy !== 'USDT') {\n trade.traded_volume = bill.sz;\n }\n if (bill.ccy === 'USDT') {\n trade.traded_value = bill.sz;\n }\n }\n // fee\n if (bill.fee !== '0') {\n trade.fee = Math.abs(Number(bill.fee)).toString();\n trade.fee_currency = bill.ccy;\n }\n });\n trade.created_at = formatTime(Number(trade.created_at));\n tradeList.push(trade);\n });\n }\n return tradeList;\n};\n\nconst getAccountTradeWithAccountId = async (accountId: string) => {\n const currentTrade = await requestSQL<ITrade[]>(\n Terminal.fromNodeEnv(),\n `\n select * from trade where account_id=${escapeSQL(accountId)} order by created_at desc limit 1;\n `,\n );\n const params: Record<string, string> = {\n type: '2',\n };\n if (currentTrade.length === 1) {\n params['begin'] = new Date(currentTrade[0].created_at ?? 0).getTime().toString();\n params['end'] = Date.now().toString();\n }\n console.log(formatTime(Date.now()), 'getAccountTrade', `params: ${JSON.stringify(params)}`);\n const tradeList = await tradeParser(accountId, params);\n console.log(formatTime(Date.now()), 'getAccountTrade', `tradeList: ${JSON.stringify(tradeList)}`);\n await requestSQL(\n Terminal.fromNodeEnv(),\n buildInsertManyIntoTableSQL(tradeList, 'trade', {\n columns: [\n 'id',\n 'account_id',\n 'product_id',\n 'traded_volume',\n 'traded_value',\n 'traded_price',\n 'direction',\n 'fee',\n 'fee_currency',\n 'created_at',\n ],\n conflictKeys: ['id'],\n }),\n );\n};\n\ndefer(() => accountUid$)\n .pipe(first())\n .subscribe((uid) => {\n const account_id = `okx/${uid}/trading`;\n console.log(formatTime(Date.now()), 'getAccountTrade', `AccountID: ${account_id}`);\n defer(() => getAccountTradeWithAccountId(account_id))\n .pipe(\n //\n repeat({ delay: 30_000 }),\n retry({ delay: 5000 }),\n timeout(10_000), // 超时设定:10 秒\n catchError((err) => {\n console.error(formatTime(Date.now()), 'getAccountTradeError', err);\n return of([]);\n }),\n )\n .subscribe();\n });\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuants/vendor-okx",
3
- "version": "0.19.0",
3
+ "version": "0.19.2",
4
4
  "bin": "lib/cli.js",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -20,7 +20,8 @@
20
20
  "@yuants/data-ohlc": "0.3.13",
21
21
  "@yuants/data-interest-rate": "0.1.14",
22
22
  "@yuants/data-quote": "0.2.9",
23
- "@yuants/secret": "0.1.9",
23
+ "@yuants/data-trade": "0.0.2",
24
+ "@yuants/secret": "0.2.0",
24
25
  "rxjs": "~7.5.6",
25
26
  "crypto-js": "^4.2.0",
26
27
  "ws": "~8.8.1"
package/temp/image-tag CHANGED
@@ -1 +1 @@
1
- sha-3bd901d2f7f304fa3d8df2b7688ffb08b3aba573
1
+ sha-a36cec00b4c05de133fac06920ee6b3c6c385e70
@@ -1,6 +1,6 @@
1
1
  {
2
- "apps/vendor-okx/CHANGELOG.json": "905665d05dec62b8a1a25fb29e7be0d69293738e",
3
- "apps/vendor-okx/CHANGELOG.md": "e7f29324dee99b52530c8f0f89be8973f416d16c",
2
+ "apps/vendor-okx/CHANGELOG.json": "eee9ae69009fcdb8d889b595ea9150f1a994e5c1",
3
+ "apps/vendor-okx/CHANGELOG.md": "f7978c2a250753210877c69bd2316ee4a4983765",
4
4
  "apps/vendor-okx/README.md": "ac3d1f6c4c8d73066664699b0bb1b01db02e67a2",
5
5
  "apps/vendor-okx/api-extractor.json": "62f4fd324425b9a235f0c117975967aab09ced0c",
6
6
  "apps/vendor-okx/build/Dockerfile": "e625b9593e496c343297c9ce133d6cc4be9617a7",
@@ -8,13 +8,13 @@
8
8
  "apps/vendor-okx/config/rig.json": "f6c7b5537dc77a3170ba9f008bae3b6c3ee11956",
9
9
  "apps/vendor-okx/config/typescript.json": "854907e8a821f2050f6533368db160c649c25348",
10
10
  "apps/vendor-okx/etc/vendor-okx.api.md": "92c54ccd547d2ad81ca6088158ca193e85c208df",
11
- "apps/vendor-okx/package.json": "85195061015636ffff411f5c11d5952465b53519",
11
+ "apps/vendor-okx/package.json": "23eaab38ab3c8bfc14073ea8b6ddc60e509bb51e",
12
12
  "apps/vendor-okx/src/account.ts": "7e8bb44845269a401a850aff2e5bf170b0811bd8",
13
13
  "apps/vendor-okx/src/api.ts": "24d7484abffc5a06c67c70c624aa7e401b3be8f2",
14
14
  "apps/vendor-okx/src/cli.ts": "9bf6b5559a6c6f33da20e74cc6c5d702c60ec891",
15
15
  "apps/vendor-okx/src/cluster.ts": "9971d8d5e6af16e09d2d1fe5e9f05ccee87281e8",
16
16
  "apps/vendor-okx/src/extension.ts": "e5c9bc791d3c4beade4c8a1854d1351ba3ddd3aa",
17
- "apps/vendor-okx/src/index.ts": "6c9f8e299d58c3acdcf99d75f3173abba085f385",
17
+ "apps/vendor-okx/src/index.ts": "79d05bc51df41c385401f2b2390551ea43c04722",
18
18
  "apps/vendor-okx/src/interest_rate.ts": "f5ee44bf6b92a484dccc57863c47a7101a78e793",
19
19
  "apps/vendor-okx/src/legacy_index.ts": "1bf031b9f8f870a099d74867292b257346344e4d",
20
20
  "apps/vendor-okx/src/logger.ts": "d25d427e74f46819a601e0cb17d5358b22c8db7b",
@@ -22,9 +22,10 @@
22
22
  "apps/vendor-okx/src/order.ts": "09509ae5af4b212cc1c99c55c436b3b0ce8bda33",
23
23
  "apps/vendor-okx/src/product.ts": "a2e7feb86bc01fe3b1af6dcb9a9ebfba6be91434",
24
24
  "apps/vendor-okx/src/quote.ts": "b8dd019e6cceb50e486a9d41e54385bda4e21ab0",
25
+ "apps/vendor-okx/src/trade.ts": "37deab9dc9ff2924ccf464124005822d776aa6fc",
25
26
  "apps/vendor-okx/src/websocket.ts": "dbfbe9785d9ce06ceae0092750f1db5518be8151",
26
27
  "apps/vendor-okx/tsconfig.json": "81da8f78196974b5d15da0edb6b2d9f48641063c",
27
- "apps/vendor-okx/.rush/temp/shrinkwrap-deps.json": "87df045a10e829fd62d50013da30fd929442d54c",
28
+ "apps/vendor-okx/.rush/temp/shrinkwrap-deps.json": "0a6205550d411d42b6d36324572e5e2a0ba166b2",
28
29
  "libraries/protocol/temp/package-deps.json": "43291b31649f44821b64235587e30fe4663fc305",
29
30
  "libraries/transfer/temp/package-deps.json": "a662579703128c1770f30f8ffaab3f5a233f9d48",
30
31
  "libraries/data-account/temp/package-deps.json": "6271fcb95ec701464eb1e36e3efad6d674644484",
@@ -36,7 +37,8 @@
36
37
  "libraries/data-ohlc/temp/package-deps.json": "d8812a8cdf4b60e7d3a66ff723f6d9ec82f27259",
37
38
  "libraries/data-interest-rate/temp/package-deps.json": "27c147717413bf219a8aef339c14411290cd7d93",
38
39
  "libraries/data-quote/temp/package-deps.json": "06ec122f1a8d33627668e30ea2a7ecbe7c04e12f",
39
- "libraries/secret/temp/package-deps.json": "9ab6e32f718f74f5358a3950ca4bf1fdb04642ca",
40
+ "libraries/data-trade/temp/package-deps.json": "58c4c30b6f194b1d98c8b904908e472312978a65",
41
+ "libraries/secret/temp/package-deps.json": "59e8d11b06181dec675c2ec58437023bf8f49a30",
40
42
  "libraries/extension/temp/package-deps.json": "f22ec5c30214f7aeeda63f46bd920290be555f57",
41
43
  "tools/toolkit/temp/package-deps.json": "eb0447c467da3a90db0913ed01e42ec0de840234"
42
44
  }