@limeint/trade-api 2.19.1 → 2.23.0
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 +6 -6
- package/dist/generated/grpc/tradeapi/v1/accounts/accounts_service.d.ts +10 -17
- package/dist/generated/grpc/tradeapi/v1/accounts/accounts_service.d.ts.map +1 -1
- package/dist/generated/grpc/tradeapi/v1/accounts/accounts_service.js +56 -102
- package/dist/generated/grpc/tradeapi/v1/accounts/accounts_service.js.map +1 -1
- package/dist/generated/grpc/tradeapi/v1/assets/assets_service.d.ts +3 -3
- package/dist/generated/grpc/tradeapi/v1/assets/assets_service.d.ts.map +1 -1
- package/dist/generated/grpc/tradeapi/v1/orders/orders_service.d.ts +28 -0
- package/dist/generated/grpc/tradeapi/v1/orders/orders_service.d.ts.map +1 -1
- package/dist/generated/grpc/tradeapi/v1/orders/orders_service.js +142 -0
- package/dist/generated/grpc/tradeapi/v1/orders/orders_service.js.map +1 -1
- package/dist/generated/grpc/tradeapi/v1/trade.d.ts +10 -0
- package/dist/generated/grpc/tradeapi/v1/trade.d.ts.map +1 -1
- package/dist/generated/grpc/tradeapi/v1/trade.js +88 -0
- package/dist/generated/grpc/tradeapi/v1/trade.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,10 +13,10 @@ A small, functional TypeScript SDK around Limeint's gRPC Trade API.
|
|
|
13
13
|
|
|
14
14
|
Node.js 20 or newer is required.
|
|
15
15
|
|
|
16
|
-
This checkout currently targets `2.
|
|
16
|
+
This checkout currently targets `2.23.0`:
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
|
-
npm install @limeint/trade-api@2.
|
|
19
|
+
npm install @limeint/trade-api@2.23.0
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Quick start
|
|
@@ -30,7 +30,7 @@ Create a clean application directory:
|
|
|
30
30
|
mkdir limeint-node-quickstart
|
|
31
31
|
cd limeint-node-quickstart
|
|
32
32
|
npm init -y
|
|
33
|
-
npm install @limeint/trade-api@2.
|
|
33
|
+
npm install @limeint/trade-api@2.23.0
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
Save this as `quickstart.mjs`. The `.mjs` extension makes the SDK's ESM import
|
|
@@ -94,7 +94,7 @@ process.once("SIGINT", () => abort.abort());
|
|
|
94
94
|
|
|
95
95
|
await withTradeApi({ secret }, async (api) => {
|
|
96
96
|
for await (const update of api.marketData.subscribeQuote(
|
|
97
|
-
{ symbols: ["AAPL@
|
|
97
|
+
{ symbols: ["AAPL@XNGS"] },
|
|
98
98
|
{ signal: abort.signal },
|
|
99
99
|
)) {
|
|
100
100
|
console.log(update);
|
|
@@ -135,7 +135,7 @@ import { OrderType, Side, TimeInForce } from "@limeint/trade-api/orders";
|
|
|
135
135
|
|
|
136
136
|
const order = await api.orders.placeOrder({
|
|
137
137
|
accountId: "A12345",
|
|
138
|
-
symbol: "AAPL@
|
|
138
|
+
symbol: "AAPL@XNGS",
|
|
139
139
|
quantity: { value: "1" },
|
|
140
140
|
side: Side.SIDE_BUY,
|
|
141
141
|
type: OrderType.ORDER_TYPE_LIMIT,
|
|
@@ -166,7 +166,7 @@ const abort = new AbortController();
|
|
|
166
166
|
process.once("SIGINT", () => abort.abort());
|
|
167
167
|
|
|
168
168
|
for await (const update of api.marketData.subscribeQuote(
|
|
169
|
-
{ symbols: ["AAPL@
|
|
169
|
+
{ symbols: ["AAPL@XNGS"] },
|
|
170
170
|
{ signal: abort.signal },
|
|
171
171
|
)) {
|
|
172
172
|
console.log(update);
|
|
@@ -28,8 +28,6 @@ export interface GetAccountResponse {
|
|
|
28
28
|
cash: Money[];
|
|
29
29
|
/** Portfolio type for accounts in US markets. */
|
|
30
30
|
portfolioMct?: MCT | undefined;
|
|
31
|
-
/** Portfolio type for trading on the Moscow Exchange derivatives market. */
|
|
32
|
-
portfolioForts?: FORTS | undefined;
|
|
33
31
|
/** Account opening date */
|
|
34
32
|
openAccountDate: Date | undefined;
|
|
35
33
|
/** Date of the first trade transaction */
|
|
@@ -43,16 +41,6 @@ export interface GetAccountResponse {
|
|
|
43
41
|
*/
|
|
44
42
|
export interface MCT {
|
|
45
43
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Portfolio type for trading on the Moscow Exchange derivatives market.
|
|
48
|
-
* Designed for working with derivative financial instruments: futures and options.
|
|
49
|
-
*/
|
|
50
|
-
export interface FORTS {
|
|
51
|
-
/** The amount of equity in the account available for trading. Includes margin funds. */
|
|
52
|
-
availableCash: Decimal | undefined;
|
|
53
|
-
/** Minimum margin (required collateral amount for open positions) */
|
|
54
|
-
moneyReserved: Decimal | undefined;
|
|
55
|
-
}
|
|
56
44
|
/** Request to receive trade history */
|
|
57
45
|
export interface TradesRequest {
|
|
58
46
|
/** Account ID */
|
|
@@ -87,16 +75,20 @@ export interface Position {
|
|
|
87
75
|
symbol: string;
|
|
88
76
|
/** Quantity in units. Signed value defining (long-short) */
|
|
89
77
|
quantity: Decimal | undefined;
|
|
90
|
-
/** Average price.
|
|
78
|
+
/** Average price. */
|
|
91
79
|
averagePrice: Decimal | undefined;
|
|
92
80
|
/** Current price */
|
|
93
81
|
currentPrice: Decimal | undefined;
|
|
94
|
-
/** Maintenance margin.
|
|
82
|
+
/** Maintenance margin. */
|
|
95
83
|
maintenanceMargin: Decimal | undefined;
|
|
96
|
-
/** Profit or loss for the current day (PnL).
|
|
84
|
+
/** Profit or loss for the current day (PnL). */
|
|
97
85
|
dailyPnl: Decimal | undefined;
|
|
98
86
|
/** Total unrealized profit or loss (PnL) of the current position */
|
|
99
87
|
unrealizedPnl: Decimal | undefined;
|
|
88
|
+
/** Currency code of the current price. */
|
|
89
|
+
currentPriceCurrency: string;
|
|
90
|
+
/** Currency code of the average price. */
|
|
91
|
+
averagePriceCurrency: string;
|
|
100
92
|
}
|
|
101
93
|
/** Transaction Information */
|
|
102
94
|
export interface Transaction {
|
|
@@ -122,6 +114,8 @@ export interface Transaction {
|
|
|
122
114
|
transactionName: string;
|
|
123
115
|
/** Change in qty only for securities transfers (for TransactionCategory = TRANSFER) */
|
|
124
116
|
changeQty: Decimal | undefined;
|
|
117
|
+
/** Full list of tickers (symbols) included in the transaction. The symbol field is retained and populated with the first element for backward compatibility. */
|
|
118
|
+
symbols: string[];
|
|
125
119
|
}
|
|
126
120
|
/** Transaction categories. */
|
|
127
121
|
export declare enum Transaction_TransactionCategory {
|
|
@@ -159,13 +153,12 @@ export interface Transaction_Trade {
|
|
|
159
153
|
size: Decimal | undefined;
|
|
160
154
|
/** Trade price per unit. Strike price/Option premium. This is the execution price; the value is taken from the trade. */
|
|
161
155
|
price: Decimal | undefined;
|
|
162
|
-
/**
|
|
156
|
+
/** Accrued interest. Completed if the transaction includes accrued interest. */
|
|
163
157
|
accruedInterest: Decimal | undefined;
|
|
164
158
|
}
|
|
165
159
|
export declare const GetAccountRequest: MessageFns<GetAccountRequest>;
|
|
166
160
|
export declare const GetAccountResponse: MessageFns<GetAccountResponse>;
|
|
167
161
|
export declare const MCT: MessageFns<MCT>;
|
|
168
|
-
export declare const FORTS: MessageFns<FORTS>;
|
|
169
162
|
export declare const TradesRequest: MessageFns<TradesRequest>;
|
|
170
163
|
export declare const TradesResponse: MessageFns<TradesResponse>;
|
|
171
164
|
export declare const TransactionsRequest: MessageFns<TransactionsRequest>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts_service.d.ts","sourceRoot":"","sources":["../../../../../../src/generated/grpc/tradeapi/v1/accounts/accounts_service.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,eAAO,MAAM,eAAe,8BAA8B,CAAC;AAE3D,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IAChC,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,MAAM,EACF,OAAO,GACP,SAAS,CAAC;IACd,wBAAwB;IACxB,gBAAgB,EACZ,OAAO,GACP,SAAS,CAAC;IACd,oEAAoE;IACpE,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,gGAAgG;IAChG,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,iDAAiD;IACjD,YAAY,CAAC,EACT,GAAG,GACH,SAAS,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"accounts_service.d.ts","sourceRoot":"","sources":["../../../../../../src/generated/grpc/tradeapi/v1/accounts/accounts_service.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,eAAO,MAAM,eAAe,8BAA8B,CAAC;AAE3D,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IAChC,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,2CAA2C;AAC3C,MAAM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AAa,CAAC,IAAI,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;CAAE,CAAC;AAEhH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,MAAM,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY,CAAC;IACxD,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;IAC7D,QAAQ,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;IACzB,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;IAC5B,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjC,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACxC"}
|
|
@@ -182,7 +182,6 @@ function createBaseGetAccountResponse() {
|
|
|
182
182
|
positions: [],
|
|
183
183
|
cash: [],
|
|
184
184
|
portfolioMct: undefined,
|
|
185
|
-
portfolioForts: undefined,
|
|
186
185
|
openAccountDate: undefined,
|
|
187
186
|
firstTradeDate: undefined,
|
|
188
187
|
firstNonTradeDate: undefined,
|
|
@@ -214,9 +213,6 @@ export const GetAccountResponse = {
|
|
|
214
213
|
if (message.portfolioMct !== undefined) {
|
|
215
214
|
MCT.encode(message.portfolioMct, writer.uint32(74).fork()).join();
|
|
216
215
|
}
|
|
217
|
-
if (message.portfolioForts !== undefined) {
|
|
218
|
-
FORTS.encode(message.portfolioForts, writer.uint32(82).fork()).join();
|
|
219
|
-
}
|
|
220
216
|
if (message.openAccountDate !== undefined) {
|
|
221
217
|
Timestamp.encode(toTimestamp(message.openAccountDate), writer.uint32(90).fork()).join();
|
|
222
218
|
}
|
|
@@ -291,13 +287,6 @@ export const GetAccountResponse = {
|
|
|
291
287
|
message.portfolioMct = MCT.decode(reader, reader.uint32());
|
|
292
288
|
continue;
|
|
293
289
|
}
|
|
294
|
-
case 10: {
|
|
295
|
-
if (tag !== 82) {
|
|
296
|
-
break;
|
|
297
|
-
}
|
|
298
|
-
message.portfolioForts = FORTS.decode(reader, reader.uint32());
|
|
299
|
-
continue;
|
|
300
|
-
}
|
|
301
290
|
case 11: {
|
|
302
291
|
if (tag !== 90) {
|
|
303
292
|
break;
|
|
@@ -351,11 +340,6 @@ export const GetAccountResponse = {
|
|
|
351
340
|
: isSet(object.portfolio_mct)
|
|
352
341
|
? MCT.fromJSON(object.portfolio_mct)
|
|
353
342
|
: undefined,
|
|
354
|
-
portfolioForts: isSet(object.portfolioForts)
|
|
355
|
-
? FORTS.fromJSON(object.portfolioForts)
|
|
356
|
-
: isSet(object.portfolio_forts)
|
|
357
|
-
? FORTS.fromJSON(object.portfolio_forts)
|
|
358
|
-
: undefined,
|
|
359
343
|
openAccountDate: isSet(object.openAccountDate)
|
|
360
344
|
? fromJsonTimestamp(object.openAccountDate)
|
|
361
345
|
: isSet(object.open_account_date)
|
|
@@ -399,9 +383,6 @@ export const GetAccountResponse = {
|
|
|
399
383
|
if (message.portfolioMct !== undefined) {
|
|
400
384
|
obj.portfolioMct = MCT.toJSON(message.portfolioMct);
|
|
401
385
|
}
|
|
402
|
-
if (message.portfolioForts !== undefined) {
|
|
403
|
-
obj.portfolioForts = FORTS.toJSON(message.portfolioForts);
|
|
404
|
-
}
|
|
405
386
|
if (message.openAccountDate !== undefined) {
|
|
406
387
|
obj.openAccountDate = message.openAccountDate.toISOString();
|
|
407
388
|
}
|
|
@@ -432,9 +413,6 @@ export const GetAccountResponse = {
|
|
|
432
413
|
message.portfolioMct = (object.portfolioMct !== undefined && object.portfolioMct !== null)
|
|
433
414
|
? MCT.fromPartial(object.portfolioMct)
|
|
434
415
|
: undefined;
|
|
435
|
-
message.portfolioForts = (object.portfolioForts !== undefined && object.portfolioForts !== null)
|
|
436
|
-
? FORTS.fromPartial(object.portfolioForts)
|
|
437
|
-
: undefined;
|
|
438
416
|
message.openAccountDate = object.openAccountDate ?? undefined;
|
|
439
417
|
message.firstTradeDate = object.firstTradeDate ?? undefined;
|
|
440
418
|
message.firstNonTradeDate = object.firstNonTradeDate ?? undefined;
|
|
@@ -478,86 +456,6 @@ export const MCT = {
|
|
|
478
456
|
return message;
|
|
479
457
|
},
|
|
480
458
|
};
|
|
481
|
-
function createBaseFORTS() {
|
|
482
|
-
return { availableCash: undefined, moneyReserved: undefined };
|
|
483
|
-
}
|
|
484
|
-
export const FORTS = {
|
|
485
|
-
encode(message, writer = new BinaryWriter()) {
|
|
486
|
-
if (message.availableCash !== undefined) {
|
|
487
|
-
Decimal.encode(message.availableCash, writer.uint32(10).fork()).join();
|
|
488
|
-
}
|
|
489
|
-
if (message.moneyReserved !== undefined) {
|
|
490
|
-
Decimal.encode(message.moneyReserved, writer.uint32(18).fork()).join();
|
|
491
|
-
}
|
|
492
|
-
return writer;
|
|
493
|
-
},
|
|
494
|
-
decode(input, length) {
|
|
495
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
496
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
497
|
-
const message = createBaseFORTS();
|
|
498
|
-
while (reader.pos < end) {
|
|
499
|
-
const tag = reader.uint32();
|
|
500
|
-
switch (tag >>> 3) {
|
|
501
|
-
case 1: {
|
|
502
|
-
if (tag !== 10) {
|
|
503
|
-
break;
|
|
504
|
-
}
|
|
505
|
-
message.availableCash = Decimal.decode(reader, reader.uint32());
|
|
506
|
-
continue;
|
|
507
|
-
}
|
|
508
|
-
case 2: {
|
|
509
|
-
if (tag !== 18) {
|
|
510
|
-
break;
|
|
511
|
-
}
|
|
512
|
-
message.moneyReserved = Decimal.decode(reader, reader.uint32());
|
|
513
|
-
continue;
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
517
|
-
break;
|
|
518
|
-
}
|
|
519
|
-
reader.skip(tag & 7);
|
|
520
|
-
}
|
|
521
|
-
return message;
|
|
522
|
-
},
|
|
523
|
-
fromJSON(object) {
|
|
524
|
-
return {
|
|
525
|
-
availableCash: isSet(object.availableCash)
|
|
526
|
-
? Decimal.fromJSON(object.availableCash)
|
|
527
|
-
: isSet(object.available_cash)
|
|
528
|
-
? Decimal.fromJSON(object.available_cash)
|
|
529
|
-
: undefined,
|
|
530
|
-
moneyReserved: isSet(object.moneyReserved)
|
|
531
|
-
? Decimal.fromJSON(object.moneyReserved)
|
|
532
|
-
: isSet(object.money_reserved)
|
|
533
|
-
? Decimal.fromJSON(object.money_reserved)
|
|
534
|
-
: undefined,
|
|
535
|
-
};
|
|
536
|
-
},
|
|
537
|
-
toJSON(message) {
|
|
538
|
-
const obj = {};
|
|
539
|
-
if (message.availableCash !== undefined) {
|
|
540
|
-
obj.availableCash = Decimal.toJSON(message.availableCash);
|
|
541
|
-
}
|
|
542
|
-
if (message.moneyReserved !== undefined) {
|
|
543
|
-
obj.moneyReserved = Decimal.toJSON(message.moneyReserved);
|
|
544
|
-
}
|
|
545
|
-
return obj;
|
|
546
|
-
},
|
|
547
|
-
create(base) {
|
|
548
|
-
return FORTS.fromPartial(base ?? {});
|
|
549
|
-
},
|
|
550
|
-
fromPartial(object) {
|
|
551
|
-
const message = createBaseFORTS();
|
|
552
|
-
message.availableCash = (object.availableCash !== undefined && object.availableCash !== null)
|
|
553
|
-
? Decimal.fromPartial(object.availableCash)
|
|
554
|
-
: undefined;
|
|
555
|
-
message.moneyReserved = (object.moneyReserved !== undefined && object.moneyReserved !== null)
|
|
556
|
-
? Decimal.fromPartial(object.moneyReserved)
|
|
557
|
-
: undefined;
|
|
558
|
-
return message;
|
|
559
|
-
},
|
|
560
|
-
};
|
|
561
459
|
function createBaseTradesRequest() {
|
|
562
460
|
return { accountId: "", limit: 0, interval: undefined };
|
|
563
461
|
}
|
|
@@ -853,6 +751,8 @@ function createBasePosition() {
|
|
|
853
751
|
maintenanceMargin: undefined,
|
|
854
752
|
dailyPnl: undefined,
|
|
855
753
|
unrealizedPnl: undefined,
|
|
754
|
+
currentPriceCurrency: "",
|
|
755
|
+
averagePriceCurrency: "",
|
|
856
756
|
};
|
|
857
757
|
}
|
|
858
758
|
export const Position = {
|
|
@@ -878,6 +778,12 @@ export const Position = {
|
|
|
878
778
|
if (message.unrealizedPnl !== undefined) {
|
|
879
779
|
Decimal.encode(message.unrealizedPnl, writer.uint32(58).fork()).join();
|
|
880
780
|
}
|
|
781
|
+
if (message.currentPriceCurrency !== "") {
|
|
782
|
+
writer.uint32(66).string(message.currentPriceCurrency);
|
|
783
|
+
}
|
|
784
|
+
if (message.averagePriceCurrency !== "") {
|
|
785
|
+
writer.uint32(74).string(message.averagePriceCurrency);
|
|
786
|
+
}
|
|
881
787
|
return writer;
|
|
882
788
|
},
|
|
883
789
|
decode(input, length) {
|
|
@@ -936,6 +842,20 @@ export const Position = {
|
|
|
936
842
|
message.unrealizedPnl = Decimal.decode(reader, reader.uint32());
|
|
937
843
|
continue;
|
|
938
844
|
}
|
|
845
|
+
case 8: {
|
|
846
|
+
if (tag !== 66) {
|
|
847
|
+
break;
|
|
848
|
+
}
|
|
849
|
+
message.currentPriceCurrency = reader.string();
|
|
850
|
+
continue;
|
|
851
|
+
}
|
|
852
|
+
case 9: {
|
|
853
|
+
if (tag !== 74) {
|
|
854
|
+
break;
|
|
855
|
+
}
|
|
856
|
+
message.averagePriceCurrency = reader.string();
|
|
857
|
+
continue;
|
|
858
|
+
}
|
|
939
859
|
}
|
|
940
860
|
if ((tag & 7) === 4 || tag === 0) {
|
|
941
861
|
break;
|
|
@@ -973,6 +893,16 @@ export const Position = {
|
|
|
973
893
|
: isSet(object.unrealized_pnl)
|
|
974
894
|
? Decimal.fromJSON(object.unrealized_pnl)
|
|
975
895
|
: undefined,
|
|
896
|
+
currentPriceCurrency: isSet(object.currentPriceCurrency)
|
|
897
|
+
? globalThis.String(object.currentPriceCurrency)
|
|
898
|
+
: isSet(object.current_price_currency)
|
|
899
|
+
? globalThis.String(object.current_price_currency)
|
|
900
|
+
: "",
|
|
901
|
+
averagePriceCurrency: isSet(object.averagePriceCurrency)
|
|
902
|
+
? globalThis.String(object.averagePriceCurrency)
|
|
903
|
+
: isSet(object.average_price_currency)
|
|
904
|
+
? globalThis.String(object.average_price_currency)
|
|
905
|
+
: "",
|
|
976
906
|
};
|
|
977
907
|
},
|
|
978
908
|
toJSON(message) {
|
|
@@ -998,6 +928,12 @@ export const Position = {
|
|
|
998
928
|
if (message.unrealizedPnl !== undefined) {
|
|
999
929
|
obj.unrealizedPnl = Decimal.toJSON(message.unrealizedPnl);
|
|
1000
930
|
}
|
|
931
|
+
if (message.currentPriceCurrency !== "") {
|
|
932
|
+
obj.currentPriceCurrency = message.currentPriceCurrency;
|
|
933
|
+
}
|
|
934
|
+
if (message.averagePriceCurrency !== "") {
|
|
935
|
+
obj.averagePriceCurrency = message.averagePriceCurrency;
|
|
936
|
+
}
|
|
1001
937
|
return obj;
|
|
1002
938
|
},
|
|
1003
939
|
create(base) {
|
|
@@ -1024,6 +960,8 @@ export const Position = {
|
|
|
1024
960
|
message.unrealizedPnl = (object.unrealizedPnl !== undefined && object.unrealizedPnl !== null)
|
|
1025
961
|
? Decimal.fromPartial(object.unrealizedPnl)
|
|
1026
962
|
: undefined;
|
|
963
|
+
message.currentPriceCurrency = object.currentPriceCurrency ?? "";
|
|
964
|
+
message.averagePriceCurrency = object.averagePriceCurrency ?? "";
|
|
1027
965
|
return message;
|
|
1028
966
|
},
|
|
1029
967
|
};
|
|
@@ -1038,6 +976,7 @@ function createBaseTransaction() {
|
|
|
1038
976
|
transactionCategory: 0,
|
|
1039
977
|
transactionName: "",
|
|
1040
978
|
changeQty: undefined,
|
|
979
|
+
symbols: [],
|
|
1041
980
|
};
|
|
1042
981
|
}
|
|
1043
982
|
export const Transaction = {
|
|
@@ -1069,6 +1008,9 @@ export const Transaction = {
|
|
|
1069
1008
|
if (message.changeQty !== undefined) {
|
|
1070
1009
|
Decimal.encode(message.changeQty, writer.uint32(82).fork()).join();
|
|
1071
1010
|
}
|
|
1011
|
+
for (const v of message.symbols) {
|
|
1012
|
+
writer.uint32(98).string(v);
|
|
1013
|
+
}
|
|
1072
1014
|
return writer;
|
|
1073
1015
|
},
|
|
1074
1016
|
decode(input, length) {
|
|
@@ -1141,6 +1083,13 @@ export const Transaction = {
|
|
|
1141
1083
|
message.changeQty = Decimal.decode(reader, reader.uint32());
|
|
1142
1084
|
continue;
|
|
1143
1085
|
}
|
|
1086
|
+
case 12: {
|
|
1087
|
+
if (tag !== 98) {
|
|
1088
|
+
break;
|
|
1089
|
+
}
|
|
1090
|
+
message.symbols.push(reader.string());
|
|
1091
|
+
continue;
|
|
1092
|
+
}
|
|
1144
1093
|
}
|
|
1145
1094
|
if ((tag & 7) === 4 || tag === 0) {
|
|
1146
1095
|
break;
|
|
@@ -1172,6 +1121,7 @@ export const Transaction = {
|
|
|
1172
1121
|
: isSet(object.change_qty)
|
|
1173
1122
|
? Decimal.fromJSON(object.change_qty)
|
|
1174
1123
|
: undefined,
|
|
1124
|
+
symbols: globalThis.Array.isArray(object?.symbols) ? object.symbols.map((e) => globalThis.String(e)) : [],
|
|
1175
1125
|
};
|
|
1176
1126
|
},
|
|
1177
1127
|
toJSON(message) {
|
|
@@ -1203,6 +1153,9 @@ export const Transaction = {
|
|
|
1203
1153
|
if (message.changeQty !== undefined) {
|
|
1204
1154
|
obj.changeQty = Decimal.toJSON(message.changeQty);
|
|
1205
1155
|
}
|
|
1156
|
+
if (message.symbols?.length) {
|
|
1157
|
+
obj.symbols = message.symbols;
|
|
1158
|
+
}
|
|
1206
1159
|
return obj;
|
|
1207
1160
|
},
|
|
1208
1161
|
create(base) {
|
|
@@ -1225,6 +1178,7 @@ export const Transaction = {
|
|
|
1225
1178
|
message.changeQty = (object.changeQty !== undefined && object.changeQty !== null)
|
|
1226
1179
|
? Decimal.fromPartial(object.changeQty)
|
|
1227
1180
|
: undefined;
|
|
1181
|
+
message.symbols = object.symbols?.map((e) => e) || [];
|
|
1228
1182
|
return message;
|
|
1229
1183
|
},
|
|
1230
1184
|
};
|