@limeint/trade-api 2.18.1-rc.1

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 (111) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +173 -0
  3. package/dist/accounts.d.ts +2 -0
  4. package/dist/accounts.d.ts.map +1 -0
  5. package/dist/accounts.js +2 -0
  6. package/dist/accounts.js.map +1 -0
  7. package/dist/assets.d.ts +2 -0
  8. package/dist/assets.d.ts.map +1 -0
  9. package/dist/assets.js +2 -0
  10. package/dist/assets.js.map +1 -0
  11. package/dist/auth.d.ts +2 -0
  12. package/dist/auth.d.ts.map +1 -0
  13. package/dist/auth.js +2 -0
  14. package/dist/auth.js.map +1 -0
  15. package/dist/client.d.ts +53 -0
  16. package/dist/client.d.ts.map +1 -0
  17. package/dist/client.js +143 -0
  18. package/dist/client.js.map +1 -0
  19. package/dist/corporate-actions.d.ts +2 -0
  20. package/dist/corporate-actions.d.ts.map +1 -0
  21. package/dist/corporate-actions.js +2 -0
  22. package/dist/corporate-actions.js.map +1 -0
  23. package/dist/errors.d.ts +31 -0
  24. package/dist/errors.d.ts.map +1 -0
  25. package/dist/errors.js +57 -0
  26. package/dist/errors.js.map +1 -0
  27. package/dist/generated/google/protobuf/timestamp.d.ts +123 -0
  28. package/dist/generated/google/protobuf/timestamp.d.ts.map +1 -0
  29. package/dist/generated/google/protobuf/timestamp.js +83 -0
  30. package/dist/generated/google/protobuf/timestamp.js.map +1 -0
  31. package/dist/generated/google/protobuf/wrappers.d.ts +106 -0
  32. package/dist/generated/google/protobuf/wrappers.d.ts.map +1 -0
  33. package/dist/generated/google/protobuf/wrappers.js +502 -0
  34. package/dist/generated/google/protobuf/wrappers.js.map +1 -0
  35. package/dist/generated/google/type/date.d.ts +50 -0
  36. package/dist/generated/google/type/date.d.ts.map +1 -0
  37. package/dist/generated/google/type/date.js +95 -0
  38. package/dist/generated/google/type/date.js.map +1 -0
  39. package/dist/generated/google/type/decimal.d.ts +91 -0
  40. package/dist/generated/google/type/decimal.d.ts.map +1 -0
  41. package/dist/generated/google/type/decimal.js +63 -0
  42. package/dist/generated/google/type/decimal.js.map +1 -0
  43. package/dist/generated/google/type/interval.d.ts +41 -0
  44. package/dist/generated/google/type/interval.d.ts.map +1 -0
  45. package/dist/generated/google/type/interval.js +110 -0
  46. package/dist/generated/google/type/interval.js.map +1 -0
  47. package/dist/generated/google/type/money.d.ts +36 -0
  48. package/dist/generated/google/type/money.d.ts.map +1 -0
  49. package/dist/generated/google/type/money.js +102 -0
  50. package/dist/generated/google/type/money.js.map +1 -0
  51. package/dist/generated/grpc/tradeapi/v1/accounts/accounts_service.d.ts +357 -0
  52. package/dist/generated/grpc/tradeapi/v1/accounts/accounts_service.d.ts.map +1 -0
  53. package/dist/generated/grpc/tradeapi/v1/accounts/accounts_service.js +1791 -0
  54. package/dist/generated/grpc/tradeapi/v1/accounts/accounts_service.js.map +1 -0
  55. package/dist/generated/grpc/tradeapi/v1/assets/assets_service.d.ts +742 -0
  56. package/dist/generated/grpc/tradeapi/v1/assets/assets_service.d.ts.map +1 -0
  57. package/dist/generated/grpc/tradeapi/v1/assets/assets_service.js +3897 -0
  58. package/dist/generated/grpc/tradeapi/v1/assets/assets_service.js.map +1 -0
  59. package/dist/generated/grpc/tradeapi/v1/auth/auth_service.d.ts +230 -0
  60. package/dist/generated/grpc/tradeapi/v1/auth/auth_service.d.ts.map +1 -0
  61. package/dist/generated/grpc/tradeapi/v1/auth/auth_service.js +779 -0
  62. package/dist/generated/grpc/tradeapi/v1/auth/auth_service.js.map +1 -0
  63. package/dist/generated/grpc/tradeapi/v1/corporateactions/corporate_actions_service.d.ts +419 -0
  64. package/dist/generated/grpc/tradeapi/v1/corporateactions/corporate_actions_service.d.ts.map +1 -0
  65. package/dist/generated/grpc/tradeapi/v1/corporateactions/corporate_actions_service.js +2844 -0
  66. package/dist/generated/grpc/tradeapi/v1/corporateactions/corporate_actions_service.js.map +1 -0
  67. package/dist/generated/grpc/tradeapi/v1/marketdata/marketdata_service.d.ts +553 -0
  68. package/dist/generated/grpc/tradeapi/v1/marketdata/marketdata_service.d.ts.map +1 -0
  69. package/dist/generated/grpc/tradeapi/v1/marketdata/marketdata_service.js +3038 -0
  70. package/dist/generated/grpc/tradeapi/v1/marketdata/marketdata_service.js.map +1 -0
  71. package/dist/generated/grpc/tradeapi/v1/metrics/usage_metrics_service.d.ts +88 -0
  72. package/dist/generated/grpc/tradeapi/v1/metrics/usage_metrics_service.d.ts.map +1 -0
  73. package/dist/generated/grpc/tradeapi/v1/metrics/usage_metrics_service.js +284 -0
  74. package/dist/generated/grpc/tradeapi/v1/metrics/usage_metrics_service.js.map +1 -0
  75. package/dist/generated/grpc/tradeapi/v1/orders/orders_service.d.ts +730 -0
  76. package/dist/generated/grpc/tradeapi/v1/orders/orders_service.d.ts.map +1 -0
  77. package/dist/generated/grpc/tradeapi/v1/orders/orders_service.js +3113 -0
  78. package/dist/generated/grpc/tradeapi/v1/orders/orders_service.js.map +1 -0
  79. package/dist/generated/grpc/tradeapi/v1/reports/reports_service.d.ts +203 -0
  80. package/dist/generated/grpc/tradeapi/v1/reports/reports_service.d.ts.map +1 -0
  81. package/dist/generated/grpc/tradeapi/v1/reports/reports_service.js +871 -0
  82. package/dist/generated/grpc/tradeapi/v1/reports/reports_service.js.map +1 -0
  83. package/dist/generated/grpc/tradeapi/v1/side.d.ts +14 -0
  84. package/dist/generated/grpc/tradeapi/v1/side.d.ts.map +1 -0
  85. package/dist/generated/grpc/tradeapi/v1/side.js +49 -0
  86. package/dist/generated/grpc/tradeapi/v1/side.js.map +1 -0
  87. package/dist/generated/grpc/tradeapi/v1/trade.d.ts +48 -0
  88. package/dist/generated/grpc/tradeapi/v1/trade.d.ts.map +1 -0
  89. package/dist/generated/grpc/tradeapi/v1/trade.js +271 -0
  90. package/dist/generated/grpc/tradeapi/v1/trade.js.map +1 -0
  91. package/dist/index.d.ts +4 -0
  92. package/dist/index.d.ts.map +1 -0
  93. package/dist/index.js +4 -0
  94. package/dist/index.js.map +1 -0
  95. package/dist/market-data.d.ts +2 -0
  96. package/dist/market-data.d.ts.map +1 -0
  97. package/dist/market-data.js +2 -0
  98. package/dist/market-data.js.map +1 -0
  99. package/dist/metrics.d.ts +2 -0
  100. package/dist/metrics.d.ts.map +1 -0
  101. package/dist/metrics.js +2 -0
  102. package/dist/metrics.js.map +1 -0
  103. package/dist/orders.d.ts +4 -0
  104. package/dist/orders.d.ts.map +1 -0
  105. package/dist/orders.js +4 -0
  106. package/dist/orders.js.map +1 -0
  107. package/dist/reports.d.ts +2 -0
  108. package/dist/reports.d.ts.map +1 -0
  109. package/dist/reports.js +2 -0
  110. package/dist/reports.js.map +1 -0
  111. package/package.json +97 -0
@@ -0,0 +1,3897 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.12.0
4
+ // protoc v3.19.1
5
+ // source: grpc/tradeapi/v1/assets/assets_service.proto
6
+ /* eslint-disable */
7
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
8
+ import { Timestamp } from "../../../../google/protobuf/timestamp.js";
9
+ import { BoolValue } from "../../../../google/protobuf/wrappers.js";
10
+ import { DateMessage } from "../../../../google/type/date.js";
11
+ import { Decimal } from "../../../../google/type/decimal.js";
12
+ import { Interval } from "../../../../google/type/interval.js";
13
+ import { Money } from "../../../../google/type/money.js";
14
+ export const protobufPackage = "grpc.tradeapi.v1.assets";
15
+ /** Acceptable price */
16
+ export var PriceType;
17
+ (function (PriceType) {
18
+ /** UNKNOWN - Unknown */
19
+ PriceType[PriceType["UNKNOWN"] = 0] = "UNKNOWN";
20
+ /** POSITIVE - Positive. Greater than zero */
21
+ PriceType[PriceType["POSITIVE"] = 1] = "POSITIVE";
22
+ /** NON_NEGATIVE - Non-negative. Greater than or equal to zero */
23
+ PriceType[PriceType["NON_NEGATIVE"] = 2] = "NON_NEGATIVE";
24
+ /** ANY - Any */
25
+ PriceType[PriceType["ANY"] = 3] = "ANY";
26
+ PriceType[PriceType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
27
+ })(PriceType || (PriceType = {}));
28
+ export function priceTypeFromJSON(object) {
29
+ switch (object) {
30
+ case 0:
31
+ case "UNKNOWN":
32
+ return PriceType.UNKNOWN;
33
+ case 1:
34
+ case "POSITIVE":
35
+ return PriceType.POSITIVE;
36
+ case 2:
37
+ case "NON_NEGATIVE":
38
+ return PriceType.NON_NEGATIVE;
39
+ case 3:
40
+ case "ANY":
41
+ return PriceType.ANY;
42
+ case -1:
43
+ case "UNRECOGNIZED":
44
+ default:
45
+ return PriceType.UNRECOGNIZED;
46
+ }
47
+ }
48
+ export function priceTypeToJSON(object) {
49
+ switch (object) {
50
+ case PriceType.UNKNOWN:
51
+ return "UNKNOWN";
52
+ case PriceType.POSITIVE:
53
+ return "POSITIVE";
54
+ case PriceType.NON_NEGATIVE:
55
+ return "NON_NEGATIVE";
56
+ case PriceType.ANY:
57
+ return "ANY";
58
+ case PriceType.UNRECOGNIZED:
59
+ default:
60
+ return "UNRECOGNIZED";
61
+ }
62
+ }
63
+ /** Option type */
64
+ export var Option_Type;
65
+ (function (Option_Type) {
66
+ /** TYPE_UNSPECIFIED - Undefined value */
67
+ Option_Type[Option_Type["TYPE_UNSPECIFIED"] = 0] = "TYPE_UNSPECIFIED";
68
+ /** TYPE_CALL - Call */
69
+ Option_Type[Option_Type["TYPE_CALL"] = 1] = "TYPE_CALL";
70
+ /** TYPE_PUT - Put */
71
+ Option_Type[Option_Type["TYPE_PUT"] = 2] = "TYPE_PUT";
72
+ Option_Type[Option_Type["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
73
+ })(Option_Type || (Option_Type = {}));
74
+ export function option_TypeFromJSON(object) {
75
+ switch (object) {
76
+ case 0:
77
+ case "TYPE_UNSPECIFIED":
78
+ return Option_Type.TYPE_UNSPECIFIED;
79
+ case 1:
80
+ case "TYPE_CALL":
81
+ return Option_Type.TYPE_CALL;
82
+ case 2:
83
+ case "TYPE_PUT":
84
+ return Option_Type.TYPE_PUT;
85
+ case -1:
86
+ case "UNRECOGNIZED":
87
+ default:
88
+ return Option_Type.UNRECOGNIZED;
89
+ }
90
+ }
91
+ export function option_TypeToJSON(object) {
92
+ switch (object) {
93
+ case Option_Type.TYPE_UNSPECIFIED:
94
+ return "TYPE_UNSPECIFIED";
95
+ case Option_Type.TYPE_CALL:
96
+ return "TYPE_CALL";
97
+ case Option_Type.TYPE_PUT:
98
+ return "TYPE_PUT";
99
+ case Option_Type.UNRECOGNIZED:
100
+ default:
101
+ return "UNRECOGNIZED";
102
+ }
103
+ }
104
+ /** Status */
105
+ export var Longable_Status;
106
+ (function (Longable_Status) {
107
+ /** NOT_AVAILABLE - Not available */
108
+ Longable_Status[Longable_Status["NOT_AVAILABLE"] = 0] = "NOT_AVAILABLE";
109
+ /** AVAILABLE - Available */
110
+ Longable_Status[Longable_Status["AVAILABLE"] = 1] = "AVAILABLE";
111
+ /** ACCOUNT_NOT_APPROVED - Prohibited at account level */
112
+ Longable_Status[Longable_Status["ACCOUNT_NOT_APPROVED"] = 2] = "ACCOUNT_NOT_APPROVED";
113
+ Longable_Status[Longable_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
114
+ })(Longable_Status || (Longable_Status = {}));
115
+ export function longable_StatusFromJSON(object) {
116
+ switch (object) {
117
+ case 0:
118
+ case "NOT_AVAILABLE":
119
+ return Longable_Status.NOT_AVAILABLE;
120
+ case 1:
121
+ case "AVAILABLE":
122
+ return Longable_Status.AVAILABLE;
123
+ case 2:
124
+ case "ACCOUNT_NOT_APPROVED":
125
+ return Longable_Status.ACCOUNT_NOT_APPROVED;
126
+ case -1:
127
+ case "UNRECOGNIZED":
128
+ default:
129
+ return Longable_Status.UNRECOGNIZED;
130
+ }
131
+ }
132
+ export function longable_StatusToJSON(object) {
133
+ switch (object) {
134
+ case Longable_Status.NOT_AVAILABLE:
135
+ return "NOT_AVAILABLE";
136
+ case Longable_Status.AVAILABLE:
137
+ return "AVAILABLE";
138
+ case Longable_Status.ACCOUNT_NOT_APPROVED:
139
+ return "ACCOUNT_NOT_APPROVED";
140
+ case Longable_Status.UNRECOGNIZED:
141
+ default:
142
+ return "UNRECOGNIZED";
143
+ }
144
+ }
145
+ /** Status */
146
+ export var Shortable_Status;
147
+ (function (Shortable_Status) {
148
+ /** NOT_AVAILABLE - Not available */
149
+ Shortable_Status[Shortable_Status["NOT_AVAILABLE"] = 0] = "NOT_AVAILABLE";
150
+ /** AVAILABLE - Available */
151
+ Shortable_Status[Shortable_Status["AVAILABLE"] = 1] = "AVAILABLE";
152
+ /** HTB - Indicates that the security is hard to borrow */
153
+ Shortable_Status[Shortable_Status["HTB"] = 2] = "HTB";
154
+ /** ACCOUNT_NOT_APPROVED - Prohibited at account level */
155
+ Shortable_Status[Shortable_Status["ACCOUNT_NOT_APPROVED"] = 3] = "ACCOUNT_NOT_APPROVED";
156
+ /** AVAILABLE_STRATEGY - Allowed as part of a strategy */
157
+ Shortable_Status[Shortable_Status["AVAILABLE_STRATEGY"] = 4] = "AVAILABLE_STRATEGY";
158
+ Shortable_Status[Shortable_Status["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
159
+ })(Shortable_Status || (Shortable_Status = {}));
160
+ export function shortable_StatusFromJSON(object) {
161
+ switch (object) {
162
+ case 0:
163
+ case "NOT_AVAILABLE":
164
+ return Shortable_Status.NOT_AVAILABLE;
165
+ case 1:
166
+ case "AVAILABLE":
167
+ return Shortable_Status.AVAILABLE;
168
+ case 2:
169
+ case "HTB":
170
+ return Shortable_Status.HTB;
171
+ case 3:
172
+ case "ACCOUNT_NOT_APPROVED":
173
+ return Shortable_Status.ACCOUNT_NOT_APPROVED;
174
+ case 4:
175
+ case "AVAILABLE_STRATEGY":
176
+ return Shortable_Status.AVAILABLE_STRATEGY;
177
+ case -1:
178
+ case "UNRECOGNIZED":
179
+ default:
180
+ return Shortable_Status.UNRECOGNIZED;
181
+ }
182
+ }
183
+ export function shortable_StatusToJSON(object) {
184
+ switch (object) {
185
+ case Shortable_Status.NOT_AVAILABLE:
186
+ return "NOT_AVAILABLE";
187
+ case Shortable_Status.AVAILABLE:
188
+ return "AVAILABLE";
189
+ case Shortable_Status.HTB:
190
+ return "HTB";
191
+ case Shortable_Status.ACCOUNT_NOT_APPROVED:
192
+ return "ACCOUNT_NOT_APPROVED";
193
+ case Shortable_Status.AVAILABLE_STRATEGY:
194
+ return "AVAILABLE_STRATEGY";
195
+ case Shortable_Status.UNRECOGNIZED:
196
+ default:
197
+ return "UNRECOGNIZED";
198
+ }
199
+ }
200
+ function createBaseExchangesRequest() {
201
+ return {};
202
+ }
203
+ export const ExchangesRequest = {
204
+ encode(_, writer = new BinaryWriter()) {
205
+ return writer;
206
+ },
207
+ decode(input, length) {
208
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
209
+ const end = length === undefined ? reader.len : reader.pos + length;
210
+ const message = createBaseExchangesRequest();
211
+ while (reader.pos < end) {
212
+ const tag = reader.uint32();
213
+ switch (tag >>> 3) {
214
+ }
215
+ if ((tag & 7) === 4 || tag === 0) {
216
+ break;
217
+ }
218
+ reader.skip(tag & 7);
219
+ }
220
+ return message;
221
+ },
222
+ fromJSON(_) {
223
+ return {};
224
+ },
225
+ toJSON(_) {
226
+ const obj = {};
227
+ return obj;
228
+ },
229
+ create(base) {
230
+ return ExchangesRequest.fromPartial(base ?? {});
231
+ },
232
+ fromPartial(_) {
233
+ const message = createBaseExchangesRequest();
234
+ return message;
235
+ },
236
+ };
237
+ function createBaseExchangesResponse() {
238
+ return { exchanges: [] };
239
+ }
240
+ export const ExchangesResponse = {
241
+ encode(message, writer = new BinaryWriter()) {
242
+ for (const v of message.exchanges) {
243
+ Exchange.encode(v, writer.uint32(10).fork()).join();
244
+ }
245
+ return writer;
246
+ },
247
+ decode(input, length) {
248
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
249
+ const end = length === undefined ? reader.len : reader.pos + length;
250
+ const message = createBaseExchangesResponse();
251
+ while (reader.pos < end) {
252
+ const tag = reader.uint32();
253
+ switch (tag >>> 3) {
254
+ case 1: {
255
+ if (tag !== 10) {
256
+ break;
257
+ }
258
+ message.exchanges.push(Exchange.decode(reader, reader.uint32()));
259
+ continue;
260
+ }
261
+ }
262
+ if ((tag & 7) === 4 || tag === 0) {
263
+ break;
264
+ }
265
+ reader.skip(tag & 7);
266
+ }
267
+ return message;
268
+ },
269
+ fromJSON(object) {
270
+ return {
271
+ exchanges: globalThis.Array.isArray(object?.exchanges)
272
+ ? object.exchanges.map((e) => Exchange.fromJSON(e))
273
+ : [],
274
+ };
275
+ },
276
+ toJSON(message) {
277
+ const obj = {};
278
+ if (message.exchanges?.length) {
279
+ obj.exchanges = message.exchanges.map((e) => Exchange.toJSON(e));
280
+ }
281
+ return obj;
282
+ },
283
+ create(base) {
284
+ return ExchangesResponse.fromPartial(base ?? {});
285
+ },
286
+ fromPartial(object) {
287
+ const message = createBaseExchangesResponse();
288
+ message.exchanges = object.exchanges?.map((e) => Exchange.fromPartial(e)) || [];
289
+ return message;
290
+ },
291
+ };
292
+ function createBaseAssetsRequest() {
293
+ return {};
294
+ }
295
+ export const AssetsRequest = {
296
+ encode(_, writer = new BinaryWriter()) {
297
+ return writer;
298
+ },
299
+ decode(input, length) {
300
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
301
+ const end = length === undefined ? reader.len : reader.pos + length;
302
+ const message = createBaseAssetsRequest();
303
+ while (reader.pos < end) {
304
+ const tag = reader.uint32();
305
+ switch (tag >>> 3) {
306
+ }
307
+ if ((tag & 7) === 4 || tag === 0) {
308
+ break;
309
+ }
310
+ reader.skip(tag & 7);
311
+ }
312
+ return message;
313
+ },
314
+ fromJSON(_) {
315
+ return {};
316
+ },
317
+ toJSON(_) {
318
+ const obj = {};
319
+ return obj;
320
+ },
321
+ create(base) {
322
+ return AssetsRequest.fromPartial(base ?? {});
323
+ },
324
+ fromPartial(_) {
325
+ const message = createBaseAssetsRequest();
326
+ return message;
327
+ },
328
+ };
329
+ function createBaseAssetsResponse() {
330
+ return { assets: [] };
331
+ }
332
+ export const AssetsResponse = {
333
+ encode(message, writer = new BinaryWriter()) {
334
+ for (const v of message.assets) {
335
+ Asset.encode(v, writer.uint32(10).fork()).join();
336
+ }
337
+ return writer;
338
+ },
339
+ decode(input, length) {
340
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
341
+ const end = length === undefined ? reader.len : reader.pos + length;
342
+ const message = createBaseAssetsResponse();
343
+ while (reader.pos < end) {
344
+ const tag = reader.uint32();
345
+ switch (tag >>> 3) {
346
+ case 1: {
347
+ if (tag !== 10) {
348
+ break;
349
+ }
350
+ message.assets.push(Asset.decode(reader, reader.uint32()));
351
+ continue;
352
+ }
353
+ }
354
+ if ((tag & 7) === 4 || tag === 0) {
355
+ break;
356
+ }
357
+ reader.skip(tag & 7);
358
+ }
359
+ return message;
360
+ },
361
+ fromJSON(object) {
362
+ return { assets: globalThis.Array.isArray(object?.assets) ? object.assets.map((e) => Asset.fromJSON(e)) : [] };
363
+ },
364
+ toJSON(message) {
365
+ const obj = {};
366
+ if (message.assets?.length) {
367
+ obj.assets = message.assets.map((e) => Asset.toJSON(e));
368
+ }
369
+ return obj;
370
+ },
371
+ create(base) {
372
+ return AssetsResponse.fromPartial(base ?? {});
373
+ },
374
+ fromPartial(object) {
375
+ const message = createBaseAssetsResponse();
376
+ message.assets = object.assets?.map((e) => Asset.fromPartial(e)) || [];
377
+ return message;
378
+ },
379
+ };
380
+ function createBaseAllAssetsRequest() {
381
+ return { cursor: 0n, onlyActive: false, onlyDisabled: false };
382
+ }
383
+ export const AllAssetsRequest = {
384
+ encode(message, writer = new BinaryWriter()) {
385
+ if (message.cursor !== 0n) {
386
+ if (BigInt.asIntN(64, message.cursor) !== message.cursor) {
387
+ throw new globalThis.Error("value provided for field message.cursor of type int64 too large");
388
+ }
389
+ writer.uint32(8).int64(message.cursor);
390
+ }
391
+ if (message.onlyActive !== false) {
392
+ writer.uint32(16).bool(message.onlyActive);
393
+ }
394
+ if (message.onlyDisabled !== false) {
395
+ writer.uint32(24).bool(message.onlyDisabled);
396
+ }
397
+ return writer;
398
+ },
399
+ decode(input, length) {
400
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
401
+ const end = length === undefined ? reader.len : reader.pos + length;
402
+ const message = createBaseAllAssetsRequest();
403
+ while (reader.pos < end) {
404
+ const tag = reader.uint32();
405
+ switch (tag >>> 3) {
406
+ case 1: {
407
+ if (tag !== 8) {
408
+ break;
409
+ }
410
+ message.cursor = reader.int64();
411
+ continue;
412
+ }
413
+ case 2: {
414
+ if (tag !== 16) {
415
+ break;
416
+ }
417
+ message.onlyActive = reader.bool();
418
+ continue;
419
+ }
420
+ case 3: {
421
+ if (tag !== 24) {
422
+ break;
423
+ }
424
+ message.onlyDisabled = reader.bool();
425
+ continue;
426
+ }
427
+ }
428
+ if ((tag & 7) === 4 || tag === 0) {
429
+ break;
430
+ }
431
+ reader.skip(tag & 7);
432
+ }
433
+ return message;
434
+ },
435
+ fromJSON(object) {
436
+ return {
437
+ cursor: isSet(object.cursor) ? BigInt(object.cursor) : 0n,
438
+ onlyActive: isSet(object.onlyActive)
439
+ ? globalThis.Boolean(object.onlyActive)
440
+ : isSet(object.only_active)
441
+ ? globalThis.Boolean(object.only_active)
442
+ : false,
443
+ onlyDisabled: isSet(object.onlyDisabled)
444
+ ? globalThis.Boolean(object.onlyDisabled)
445
+ : isSet(object.only_disabled)
446
+ ? globalThis.Boolean(object.only_disabled)
447
+ : false,
448
+ };
449
+ },
450
+ toJSON(message) {
451
+ const obj = {};
452
+ if (message.cursor !== 0n) {
453
+ obj.cursor = message.cursor.toString();
454
+ }
455
+ if (message.onlyActive !== false) {
456
+ obj.onlyActive = message.onlyActive;
457
+ }
458
+ if (message.onlyDisabled !== false) {
459
+ obj.onlyDisabled = message.onlyDisabled;
460
+ }
461
+ return obj;
462
+ },
463
+ create(base) {
464
+ return AllAssetsRequest.fromPartial(base ?? {});
465
+ },
466
+ fromPartial(object) {
467
+ const message = createBaseAllAssetsRequest();
468
+ message.cursor = (object.cursor !== undefined && object.cursor !== null) ? BigInt(object.cursor) : 0n;
469
+ message.onlyActive = object.onlyActive ?? false;
470
+ message.onlyDisabled = object.onlyDisabled ?? false;
471
+ return message;
472
+ },
473
+ };
474
+ function createBaseAllAssetsResponse() {
475
+ return { assets: [], nextCursor: 0n };
476
+ }
477
+ export const AllAssetsResponse = {
478
+ encode(message, writer = new BinaryWriter()) {
479
+ for (const v of message.assets) {
480
+ Asset.encode(v, writer.uint32(10).fork()).join();
481
+ }
482
+ if (message.nextCursor !== 0n) {
483
+ if (BigInt.asIntN(64, message.nextCursor) !== message.nextCursor) {
484
+ throw new globalThis.Error("value provided for field message.nextCursor of type int64 too large");
485
+ }
486
+ writer.uint32(16).int64(message.nextCursor);
487
+ }
488
+ return writer;
489
+ },
490
+ decode(input, length) {
491
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
492
+ const end = length === undefined ? reader.len : reader.pos + length;
493
+ const message = createBaseAllAssetsResponse();
494
+ while (reader.pos < end) {
495
+ const tag = reader.uint32();
496
+ switch (tag >>> 3) {
497
+ case 1: {
498
+ if (tag !== 10) {
499
+ break;
500
+ }
501
+ message.assets.push(Asset.decode(reader, reader.uint32()));
502
+ continue;
503
+ }
504
+ case 2: {
505
+ if (tag !== 16) {
506
+ break;
507
+ }
508
+ message.nextCursor = reader.int64();
509
+ continue;
510
+ }
511
+ }
512
+ if ((tag & 7) === 4 || tag === 0) {
513
+ break;
514
+ }
515
+ reader.skip(tag & 7);
516
+ }
517
+ return message;
518
+ },
519
+ fromJSON(object) {
520
+ return {
521
+ assets: globalThis.Array.isArray(object?.assets) ? object.assets.map((e) => Asset.fromJSON(e)) : [],
522
+ nextCursor: isSet(object.nextCursor)
523
+ ? BigInt(object.nextCursor)
524
+ : isSet(object.next_cursor)
525
+ ? BigInt(object.next_cursor)
526
+ : 0n,
527
+ };
528
+ },
529
+ toJSON(message) {
530
+ const obj = {};
531
+ if (message.assets?.length) {
532
+ obj.assets = message.assets.map((e) => Asset.toJSON(e));
533
+ }
534
+ if (message.nextCursor !== 0n) {
535
+ obj.nextCursor = message.nextCursor.toString();
536
+ }
537
+ return obj;
538
+ },
539
+ create(base) {
540
+ return AllAssetsResponse.fromPartial(base ?? {});
541
+ },
542
+ fromPartial(object) {
543
+ const message = createBaseAllAssetsResponse();
544
+ message.assets = object.assets?.map((e) => Asset.fromPartial(e)) || [];
545
+ message.nextCursor = (object.nextCursor !== undefined && object.nextCursor !== null)
546
+ ? BigInt(object.nextCursor)
547
+ : 0n;
548
+ return message;
549
+ },
550
+ };
551
+ function createBaseGetAssetRequest() {
552
+ return { symbol: "", accountId: "" };
553
+ }
554
+ export const GetAssetRequest = {
555
+ encode(message, writer = new BinaryWriter()) {
556
+ if (message.symbol !== "") {
557
+ writer.uint32(10).string(message.symbol);
558
+ }
559
+ if (message.accountId !== "") {
560
+ writer.uint32(18).string(message.accountId);
561
+ }
562
+ return writer;
563
+ },
564
+ decode(input, length) {
565
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
566
+ const end = length === undefined ? reader.len : reader.pos + length;
567
+ const message = createBaseGetAssetRequest();
568
+ while (reader.pos < end) {
569
+ const tag = reader.uint32();
570
+ switch (tag >>> 3) {
571
+ case 1: {
572
+ if (tag !== 10) {
573
+ break;
574
+ }
575
+ message.symbol = reader.string();
576
+ continue;
577
+ }
578
+ case 2: {
579
+ if (tag !== 18) {
580
+ break;
581
+ }
582
+ message.accountId = reader.string();
583
+ continue;
584
+ }
585
+ }
586
+ if ((tag & 7) === 4 || tag === 0) {
587
+ break;
588
+ }
589
+ reader.skip(tag & 7);
590
+ }
591
+ return message;
592
+ },
593
+ fromJSON(object) {
594
+ return {
595
+ symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : "",
596
+ accountId: isSet(object.accountId)
597
+ ? globalThis.String(object.accountId)
598
+ : isSet(object.account_id)
599
+ ? globalThis.String(object.account_id)
600
+ : "",
601
+ };
602
+ },
603
+ toJSON(message) {
604
+ const obj = {};
605
+ if (message.symbol !== "") {
606
+ obj.symbol = message.symbol;
607
+ }
608
+ if (message.accountId !== "") {
609
+ obj.accountId = message.accountId;
610
+ }
611
+ return obj;
612
+ },
613
+ create(base) {
614
+ return GetAssetRequest.fromPartial(base ?? {});
615
+ },
616
+ fromPartial(object) {
617
+ const message = createBaseGetAssetRequest();
618
+ message.symbol = object.symbol ?? "";
619
+ message.accountId = object.accountId ?? "";
620
+ return message;
621
+ },
622
+ };
623
+ function createBaseGetAssetResponse() {
624
+ return {
625
+ board: "",
626
+ id: "",
627
+ ticker: "",
628
+ mic: "",
629
+ isin: "",
630
+ type: "",
631
+ name: "",
632
+ decimals: 0,
633
+ minStep: 0n,
634
+ lotSize: undefined,
635
+ expirationDate: undefined,
636
+ quoteCurrency: "",
637
+ futureDetails: undefined,
638
+ optionDetails: undefined,
639
+ bondDetails: undefined,
640
+ };
641
+ }
642
+ export const GetAssetResponse = {
643
+ encode(message, writer = new BinaryWriter()) {
644
+ if (message.board !== "") {
645
+ writer.uint32(10).string(message.board);
646
+ }
647
+ if (message.id !== "") {
648
+ writer.uint32(18).string(message.id);
649
+ }
650
+ if (message.ticker !== "") {
651
+ writer.uint32(26).string(message.ticker);
652
+ }
653
+ if (message.mic !== "") {
654
+ writer.uint32(34).string(message.mic);
655
+ }
656
+ if (message.isin !== "") {
657
+ writer.uint32(42).string(message.isin);
658
+ }
659
+ if (message.type !== "") {
660
+ writer.uint32(50).string(message.type);
661
+ }
662
+ if (message.name !== "") {
663
+ writer.uint32(58).string(message.name);
664
+ }
665
+ if (message.decimals !== 0) {
666
+ writer.uint32(80).int32(message.decimals);
667
+ }
668
+ if (message.minStep !== 0n) {
669
+ if (BigInt.asIntN(64, message.minStep) !== message.minStep) {
670
+ throw new globalThis.Error("value provided for field message.minStep of type int64 too large");
671
+ }
672
+ writer.uint32(88).int64(message.minStep);
673
+ }
674
+ if (message.lotSize !== undefined) {
675
+ Decimal.encode(message.lotSize, writer.uint32(74).fork()).join();
676
+ }
677
+ if (message.expirationDate !== undefined) {
678
+ DateMessage.encode(message.expirationDate, writer.uint32(98).fork()).join();
679
+ }
680
+ if (message.quoteCurrency !== "") {
681
+ writer.uint32(106).string(message.quoteCurrency);
682
+ }
683
+ if (message.futureDetails !== undefined) {
684
+ GetAssetResponse_FutureDetails.encode(message.futureDetails, writer.uint32(114).fork()).join();
685
+ }
686
+ if (message.optionDetails !== undefined) {
687
+ GetAssetResponse_OptionDetails.encode(message.optionDetails, writer.uint32(122).fork()).join();
688
+ }
689
+ if (message.bondDetails !== undefined) {
690
+ GetAssetResponse_BondDetails.encode(message.bondDetails, writer.uint32(130).fork()).join();
691
+ }
692
+ return writer;
693
+ },
694
+ decode(input, length) {
695
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
696
+ const end = length === undefined ? reader.len : reader.pos + length;
697
+ const message = createBaseGetAssetResponse();
698
+ while (reader.pos < end) {
699
+ const tag = reader.uint32();
700
+ switch (tag >>> 3) {
701
+ case 1: {
702
+ if (tag !== 10) {
703
+ break;
704
+ }
705
+ message.board = reader.string();
706
+ continue;
707
+ }
708
+ case 2: {
709
+ if (tag !== 18) {
710
+ break;
711
+ }
712
+ message.id = reader.string();
713
+ continue;
714
+ }
715
+ case 3: {
716
+ if (tag !== 26) {
717
+ break;
718
+ }
719
+ message.ticker = reader.string();
720
+ continue;
721
+ }
722
+ case 4: {
723
+ if (tag !== 34) {
724
+ break;
725
+ }
726
+ message.mic = reader.string();
727
+ continue;
728
+ }
729
+ case 5: {
730
+ if (tag !== 42) {
731
+ break;
732
+ }
733
+ message.isin = reader.string();
734
+ continue;
735
+ }
736
+ case 6: {
737
+ if (tag !== 50) {
738
+ break;
739
+ }
740
+ message.type = reader.string();
741
+ continue;
742
+ }
743
+ case 7: {
744
+ if (tag !== 58) {
745
+ break;
746
+ }
747
+ message.name = reader.string();
748
+ continue;
749
+ }
750
+ case 10: {
751
+ if (tag !== 80) {
752
+ break;
753
+ }
754
+ message.decimals = reader.int32();
755
+ continue;
756
+ }
757
+ case 11: {
758
+ if (tag !== 88) {
759
+ break;
760
+ }
761
+ message.minStep = reader.int64();
762
+ continue;
763
+ }
764
+ case 9: {
765
+ if (tag !== 74) {
766
+ break;
767
+ }
768
+ message.lotSize = Decimal.decode(reader, reader.uint32());
769
+ continue;
770
+ }
771
+ case 12: {
772
+ if (tag !== 98) {
773
+ break;
774
+ }
775
+ message.expirationDate = DateMessage.decode(reader, reader.uint32());
776
+ continue;
777
+ }
778
+ case 13: {
779
+ if (tag !== 106) {
780
+ break;
781
+ }
782
+ message.quoteCurrency = reader.string();
783
+ continue;
784
+ }
785
+ case 14: {
786
+ if (tag !== 114) {
787
+ break;
788
+ }
789
+ message.futureDetails = GetAssetResponse_FutureDetails.decode(reader, reader.uint32());
790
+ continue;
791
+ }
792
+ case 15: {
793
+ if (tag !== 122) {
794
+ break;
795
+ }
796
+ message.optionDetails = GetAssetResponse_OptionDetails.decode(reader, reader.uint32());
797
+ continue;
798
+ }
799
+ case 16: {
800
+ if (tag !== 130) {
801
+ break;
802
+ }
803
+ message.bondDetails = GetAssetResponse_BondDetails.decode(reader, reader.uint32());
804
+ continue;
805
+ }
806
+ }
807
+ if ((tag & 7) === 4 || tag === 0) {
808
+ break;
809
+ }
810
+ reader.skip(tag & 7);
811
+ }
812
+ return message;
813
+ },
814
+ fromJSON(object) {
815
+ return {
816
+ board: isSet(object.board) ? globalThis.String(object.board) : "",
817
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
818
+ ticker: isSet(object.ticker) ? globalThis.String(object.ticker) : "",
819
+ mic: isSet(object.mic) ? globalThis.String(object.mic) : "",
820
+ isin: isSet(object.isin) ? globalThis.String(object.isin) : "",
821
+ type: isSet(object.type) ? globalThis.String(object.type) : "",
822
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
823
+ decimals: isSet(object.decimals) ? globalThis.Number(object.decimals) : 0,
824
+ minStep: isSet(object.minStep) ? BigInt(object.minStep) : isSet(object.min_step) ? BigInt(object.min_step) : 0n,
825
+ lotSize: isSet(object.lotSize)
826
+ ? Decimal.fromJSON(object.lotSize)
827
+ : isSet(object.lot_size)
828
+ ? Decimal.fromJSON(object.lot_size)
829
+ : undefined,
830
+ expirationDate: isSet(object.expirationDate)
831
+ ? DateMessage.fromJSON(object.expirationDate)
832
+ : isSet(object.expiration_date)
833
+ ? DateMessage.fromJSON(object.expiration_date)
834
+ : undefined,
835
+ quoteCurrency: isSet(object.quoteCurrency)
836
+ ? globalThis.String(object.quoteCurrency)
837
+ : isSet(object.quote_currency)
838
+ ? globalThis.String(object.quote_currency)
839
+ : "",
840
+ futureDetails: isSet(object.futureDetails)
841
+ ? GetAssetResponse_FutureDetails.fromJSON(object.futureDetails)
842
+ : isSet(object.future_details)
843
+ ? GetAssetResponse_FutureDetails.fromJSON(object.future_details)
844
+ : undefined,
845
+ optionDetails: isSet(object.optionDetails)
846
+ ? GetAssetResponse_OptionDetails.fromJSON(object.optionDetails)
847
+ : isSet(object.option_details)
848
+ ? GetAssetResponse_OptionDetails.fromJSON(object.option_details)
849
+ : undefined,
850
+ bondDetails: isSet(object.bondDetails)
851
+ ? GetAssetResponse_BondDetails.fromJSON(object.bondDetails)
852
+ : isSet(object.bond_details)
853
+ ? GetAssetResponse_BondDetails.fromJSON(object.bond_details)
854
+ : undefined,
855
+ };
856
+ },
857
+ toJSON(message) {
858
+ const obj = {};
859
+ if (message.board !== "") {
860
+ obj.board = message.board;
861
+ }
862
+ if (message.id !== "") {
863
+ obj.id = message.id;
864
+ }
865
+ if (message.ticker !== "") {
866
+ obj.ticker = message.ticker;
867
+ }
868
+ if (message.mic !== "") {
869
+ obj.mic = message.mic;
870
+ }
871
+ if (message.isin !== "") {
872
+ obj.isin = message.isin;
873
+ }
874
+ if (message.type !== "") {
875
+ obj.type = message.type;
876
+ }
877
+ if (message.name !== "") {
878
+ obj.name = message.name;
879
+ }
880
+ if (message.decimals !== 0) {
881
+ obj.decimals = Math.round(message.decimals);
882
+ }
883
+ if (message.minStep !== 0n) {
884
+ obj.minStep = message.minStep.toString();
885
+ }
886
+ if (message.lotSize !== undefined) {
887
+ obj.lotSize = Decimal.toJSON(message.lotSize);
888
+ }
889
+ if (message.expirationDate !== undefined) {
890
+ obj.expirationDate = DateMessage.toJSON(message.expirationDate);
891
+ }
892
+ if (message.quoteCurrency !== "") {
893
+ obj.quoteCurrency = message.quoteCurrency;
894
+ }
895
+ if (message.futureDetails !== undefined) {
896
+ obj.futureDetails = GetAssetResponse_FutureDetails.toJSON(message.futureDetails);
897
+ }
898
+ if (message.optionDetails !== undefined) {
899
+ obj.optionDetails = GetAssetResponse_OptionDetails.toJSON(message.optionDetails);
900
+ }
901
+ if (message.bondDetails !== undefined) {
902
+ obj.bondDetails = GetAssetResponse_BondDetails.toJSON(message.bondDetails);
903
+ }
904
+ return obj;
905
+ },
906
+ create(base) {
907
+ return GetAssetResponse.fromPartial(base ?? {});
908
+ },
909
+ fromPartial(object) {
910
+ const message = createBaseGetAssetResponse();
911
+ message.board = object.board ?? "";
912
+ message.id = object.id ?? "";
913
+ message.ticker = object.ticker ?? "";
914
+ message.mic = object.mic ?? "";
915
+ message.isin = object.isin ?? "";
916
+ message.type = object.type ?? "";
917
+ message.name = object.name ?? "";
918
+ message.decimals = object.decimals ?? 0;
919
+ message.minStep = (object.minStep !== undefined && object.minStep !== null) ? BigInt(object.minStep) : 0n;
920
+ message.lotSize = (object.lotSize !== undefined && object.lotSize !== null)
921
+ ? Decimal.fromPartial(object.lotSize)
922
+ : undefined;
923
+ message.expirationDate = (object.expirationDate !== undefined && object.expirationDate !== null)
924
+ ? DateMessage.fromPartial(object.expirationDate)
925
+ : undefined;
926
+ message.quoteCurrency = object.quoteCurrency ?? "";
927
+ message.futureDetails = (object.futureDetails !== undefined && object.futureDetails !== null)
928
+ ? GetAssetResponse_FutureDetails.fromPartial(object.futureDetails)
929
+ : undefined;
930
+ message.optionDetails = (object.optionDetails !== undefined && object.optionDetails !== null)
931
+ ? GetAssetResponse_OptionDetails.fromPartial(object.optionDetails)
932
+ : undefined;
933
+ message.bondDetails = (object.bondDetails !== undefined && object.bondDetails !== null)
934
+ ? GetAssetResponse_BondDetails.fromPartial(object.bondDetails)
935
+ : undefined;
936
+ return message;
937
+ },
938
+ };
939
+ function createBaseGetAssetResponse_FutureDetails() {
940
+ return { expirationDate: undefined, contractSize: undefined };
941
+ }
942
+ export const GetAssetResponse_FutureDetails = {
943
+ encode(message, writer = new BinaryWriter()) {
944
+ if (message.expirationDate !== undefined) {
945
+ Timestamp.encode(toTimestamp(message.expirationDate), writer.uint32(10).fork()).join();
946
+ }
947
+ if (message.contractSize !== undefined) {
948
+ Decimal.encode(message.contractSize, writer.uint32(18).fork()).join();
949
+ }
950
+ return writer;
951
+ },
952
+ decode(input, length) {
953
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
954
+ const end = length === undefined ? reader.len : reader.pos + length;
955
+ const message = createBaseGetAssetResponse_FutureDetails();
956
+ while (reader.pos < end) {
957
+ const tag = reader.uint32();
958
+ switch (tag >>> 3) {
959
+ case 1: {
960
+ if (tag !== 10) {
961
+ break;
962
+ }
963
+ message.expirationDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
964
+ continue;
965
+ }
966
+ case 2: {
967
+ if (tag !== 18) {
968
+ break;
969
+ }
970
+ message.contractSize = Decimal.decode(reader, reader.uint32());
971
+ continue;
972
+ }
973
+ }
974
+ if ((tag & 7) === 4 || tag === 0) {
975
+ break;
976
+ }
977
+ reader.skip(tag & 7);
978
+ }
979
+ return message;
980
+ },
981
+ fromJSON(object) {
982
+ return {
983
+ expirationDate: isSet(object.expirationDate)
984
+ ? fromJsonTimestamp(object.expirationDate)
985
+ : isSet(object.expiration_date)
986
+ ? fromJsonTimestamp(object.expiration_date)
987
+ : undefined,
988
+ contractSize: isSet(object.contractSize)
989
+ ? Decimal.fromJSON(object.contractSize)
990
+ : isSet(object.contract_size)
991
+ ? Decimal.fromJSON(object.contract_size)
992
+ : undefined,
993
+ };
994
+ },
995
+ toJSON(message) {
996
+ const obj = {};
997
+ if (message.expirationDate !== undefined) {
998
+ obj.expirationDate = message.expirationDate.toISOString();
999
+ }
1000
+ if (message.contractSize !== undefined) {
1001
+ obj.contractSize = Decimal.toJSON(message.contractSize);
1002
+ }
1003
+ return obj;
1004
+ },
1005
+ create(base) {
1006
+ return GetAssetResponse_FutureDetails.fromPartial(base ?? {});
1007
+ },
1008
+ fromPartial(object) {
1009
+ const message = createBaseGetAssetResponse_FutureDetails();
1010
+ message.expirationDate = object.expirationDate ?? undefined;
1011
+ message.contractSize = (object.contractSize !== undefined && object.contractSize !== null)
1012
+ ? Decimal.fromPartial(object.contractSize)
1013
+ : undefined;
1014
+ return message;
1015
+ },
1016
+ };
1017
+ function createBaseGetAssetResponse_OptionDetails() {
1018
+ return { expirationDate: undefined, contractSize: undefined, strike: undefined };
1019
+ }
1020
+ export const GetAssetResponse_OptionDetails = {
1021
+ encode(message, writer = new BinaryWriter()) {
1022
+ if (message.expirationDate !== undefined) {
1023
+ Timestamp.encode(toTimestamp(message.expirationDate), writer.uint32(10).fork()).join();
1024
+ }
1025
+ if (message.contractSize !== undefined) {
1026
+ Decimal.encode(message.contractSize, writer.uint32(18).fork()).join();
1027
+ }
1028
+ if (message.strike !== undefined) {
1029
+ Decimal.encode(message.strike, writer.uint32(26).fork()).join();
1030
+ }
1031
+ return writer;
1032
+ },
1033
+ decode(input, length) {
1034
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1035
+ const end = length === undefined ? reader.len : reader.pos + length;
1036
+ const message = createBaseGetAssetResponse_OptionDetails();
1037
+ while (reader.pos < end) {
1038
+ const tag = reader.uint32();
1039
+ switch (tag >>> 3) {
1040
+ case 1: {
1041
+ if (tag !== 10) {
1042
+ break;
1043
+ }
1044
+ message.expirationDate = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1045
+ continue;
1046
+ }
1047
+ case 2: {
1048
+ if (tag !== 18) {
1049
+ break;
1050
+ }
1051
+ message.contractSize = Decimal.decode(reader, reader.uint32());
1052
+ continue;
1053
+ }
1054
+ case 3: {
1055
+ if (tag !== 26) {
1056
+ break;
1057
+ }
1058
+ message.strike = Decimal.decode(reader, reader.uint32());
1059
+ continue;
1060
+ }
1061
+ }
1062
+ if ((tag & 7) === 4 || tag === 0) {
1063
+ break;
1064
+ }
1065
+ reader.skip(tag & 7);
1066
+ }
1067
+ return message;
1068
+ },
1069
+ fromJSON(object) {
1070
+ return {
1071
+ expirationDate: isSet(object.expirationDate)
1072
+ ? fromJsonTimestamp(object.expirationDate)
1073
+ : isSet(object.expiration_date)
1074
+ ? fromJsonTimestamp(object.expiration_date)
1075
+ : undefined,
1076
+ contractSize: isSet(object.contractSize)
1077
+ ? Decimal.fromJSON(object.contractSize)
1078
+ : isSet(object.contract_size)
1079
+ ? Decimal.fromJSON(object.contract_size)
1080
+ : undefined,
1081
+ strike: isSet(object.strike) ? Decimal.fromJSON(object.strike) : undefined,
1082
+ };
1083
+ },
1084
+ toJSON(message) {
1085
+ const obj = {};
1086
+ if (message.expirationDate !== undefined) {
1087
+ obj.expirationDate = message.expirationDate.toISOString();
1088
+ }
1089
+ if (message.contractSize !== undefined) {
1090
+ obj.contractSize = Decimal.toJSON(message.contractSize);
1091
+ }
1092
+ if (message.strike !== undefined) {
1093
+ obj.strike = Decimal.toJSON(message.strike);
1094
+ }
1095
+ return obj;
1096
+ },
1097
+ create(base) {
1098
+ return GetAssetResponse_OptionDetails.fromPartial(base ?? {});
1099
+ },
1100
+ fromPartial(object) {
1101
+ const message = createBaseGetAssetResponse_OptionDetails();
1102
+ message.expirationDate = object.expirationDate ?? undefined;
1103
+ message.contractSize = (object.contractSize !== undefined && object.contractSize !== null)
1104
+ ? Decimal.fromPartial(object.contractSize)
1105
+ : undefined;
1106
+ message.strike = (object.strike !== undefined && object.strike !== null)
1107
+ ? Decimal.fromPartial(object.strike)
1108
+ : undefined;
1109
+ return message;
1110
+ },
1111
+ };
1112
+ function createBaseGetAssetResponse_BondDetails() {
1113
+ return { bondFaceValue: undefined, currency: "" };
1114
+ }
1115
+ export const GetAssetResponse_BondDetails = {
1116
+ encode(message, writer = new BinaryWriter()) {
1117
+ if (message.bondFaceValue !== undefined) {
1118
+ Decimal.encode(message.bondFaceValue, writer.uint32(10).fork()).join();
1119
+ }
1120
+ if (message.currency !== "") {
1121
+ writer.uint32(18).string(message.currency);
1122
+ }
1123
+ return writer;
1124
+ },
1125
+ decode(input, length) {
1126
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1127
+ const end = length === undefined ? reader.len : reader.pos + length;
1128
+ const message = createBaseGetAssetResponse_BondDetails();
1129
+ while (reader.pos < end) {
1130
+ const tag = reader.uint32();
1131
+ switch (tag >>> 3) {
1132
+ case 1: {
1133
+ if (tag !== 10) {
1134
+ break;
1135
+ }
1136
+ message.bondFaceValue = Decimal.decode(reader, reader.uint32());
1137
+ continue;
1138
+ }
1139
+ case 2: {
1140
+ if (tag !== 18) {
1141
+ break;
1142
+ }
1143
+ message.currency = reader.string();
1144
+ continue;
1145
+ }
1146
+ }
1147
+ if ((tag & 7) === 4 || tag === 0) {
1148
+ break;
1149
+ }
1150
+ reader.skip(tag & 7);
1151
+ }
1152
+ return message;
1153
+ },
1154
+ fromJSON(object) {
1155
+ return {
1156
+ bondFaceValue: isSet(object.bondFaceValue)
1157
+ ? Decimal.fromJSON(object.bondFaceValue)
1158
+ : isSet(object.bond_face_value)
1159
+ ? Decimal.fromJSON(object.bond_face_value)
1160
+ : undefined,
1161
+ currency: isSet(object.currency) ? globalThis.String(object.currency) : "",
1162
+ };
1163
+ },
1164
+ toJSON(message) {
1165
+ const obj = {};
1166
+ if (message.bondFaceValue !== undefined) {
1167
+ obj.bondFaceValue = Decimal.toJSON(message.bondFaceValue);
1168
+ }
1169
+ if (message.currency !== "") {
1170
+ obj.currency = message.currency;
1171
+ }
1172
+ return obj;
1173
+ },
1174
+ create(base) {
1175
+ return GetAssetResponse_BondDetails.fromPartial(base ?? {});
1176
+ },
1177
+ fromPartial(object) {
1178
+ const message = createBaseGetAssetResponse_BondDetails();
1179
+ message.bondFaceValue = (object.bondFaceValue !== undefined && object.bondFaceValue !== null)
1180
+ ? Decimal.fromPartial(object.bondFaceValue)
1181
+ : undefined;
1182
+ message.currency = object.currency ?? "";
1183
+ return message;
1184
+ },
1185
+ };
1186
+ function createBaseGetAssetParamsRequest() {
1187
+ return { symbol: "", accountId: "" };
1188
+ }
1189
+ export const GetAssetParamsRequest = {
1190
+ encode(message, writer = new BinaryWriter()) {
1191
+ if (message.symbol !== "") {
1192
+ writer.uint32(10).string(message.symbol);
1193
+ }
1194
+ if (message.accountId !== "") {
1195
+ writer.uint32(18).string(message.accountId);
1196
+ }
1197
+ return writer;
1198
+ },
1199
+ decode(input, length) {
1200
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1201
+ const end = length === undefined ? reader.len : reader.pos + length;
1202
+ const message = createBaseGetAssetParamsRequest();
1203
+ while (reader.pos < end) {
1204
+ const tag = reader.uint32();
1205
+ switch (tag >>> 3) {
1206
+ case 1: {
1207
+ if (tag !== 10) {
1208
+ break;
1209
+ }
1210
+ message.symbol = reader.string();
1211
+ continue;
1212
+ }
1213
+ case 2: {
1214
+ if (tag !== 18) {
1215
+ break;
1216
+ }
1217
+ message.accountId = reader.string();
1218
+ continue;
1219
+ }
1220
+ }
1221
+ if ((tag & 7) === 4 || tag === 0) {
1222
+ break;
1223
+ }
1224
+ reader.skip(tag & 7);
1225
+ }
1226
+ return message;
1227
+ },
1228
+ fromJSON(object) {
1229
+ return {
1230
+ symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : "",
1231
+ accountId: isSet(object.accountId)
1232
+ ? globalThis.String(object.accountId)
1233
+ : isSet(object.account_id)
1234
+ ? globalThis.String(object.account_id)
1235
+ : "",
1236
+ };
1237
+ },
1238
+ toJSON(message) {
1239
+ const obj = {};
1240
+ if (message.symbol !== "") {
1241
+ obj.symbol = message.symbol;
1242
+ }
1243
+ if (message.accountId !== "") {
1244
+ obj.accountId = message.accountId;
1245
+ }
1246
+ return obj;
1247
+ },
1248
+ create(base) {
1249
+ return GetAssetParamsRequest.fromPartial(base ?? {});
1250
+ },
1251
+ fromPartial(object) {
1252
+ const message = createBaseGetAssetParamsRequest();
1253
+ message.symbol = object.symbol ?? "";
1254
+ message.accountId = object.accountId ?? "";
1255
+ return message;
1256
+ },
1257
+ };
1258
+ function createBaseGetAssetParamsResponse() {
1259
+ return {
1260
+ symbol: "",
1261
+ accountId: "",
1262
+ tradeable: false,
1263
+ longable: undefined,
1264
+ shortable: undefined,
1265
+ longRiskRate: undefined,
1266
+ longCollateral: undefined,
1267
+ shortRiskRate: undefined,
1268
+ shortCollateral: undefined,
1269
+ longInitialMargin: undefined,
1270
+ shortInitialMargin: undefined,
1271
+ isTradable: undefined,
1272
+ priceType: 0,
1273
+ };
1274
+ }
1275
+ export const GetAssetParamsResponse = {
1276
+ encode(message, writer = new BinaryWriter()) {
1277
+ if (message.symbol !== "") {
1278
+ writer.uint32(10).string(message.symbol);
1279
+ }
1280
+ if (message.accountId !== "") {
1281
+ writer.uint32(18).string(message.accountId);
1282
+ }
1283
+ if (message.tradeable !== false) {
1284
+ writer.uint32(24).bool(message.tradeable);
1285
+ }
1286
+ if (message.longable !== undefined) {
1287
+ Longable.encode(message.longable, writer.uint32(34).fork()).join();
1288
+ }
1289
+ if (message.shortable !== undefined) {
1290
+ Shortable.encode(message.shortable, writer.uint32(42).fork()).join();
1291
+ }
1292
+ if (message.longRiskRate !== undefined) {
1293
+ Decimal.encode(message.longRiskRate, writer.uint32(50).fork()).join();
1294
+ }
1295
+ if (message.longCollateral !== undefined) {
1296
+ Money.encode(message.longCollateral, writer.uint32(58).fork()).join();
1297
+ }
1298
+ if (message.shortRiskRate !== undefined) {
1299
+ Decimal.encode(message.shortRiskRate, writer.uint32(66).fork()).join();
1300
+ }
1301
+ if (message.shortCollateral !== undefined) {
1302
+ Money.encode(message.shortCollateral, writer.uint32(74).fork()).join();
1303
+ }
1304
+ if (message.longInitialMargin !== undefined) {
1305
+ Money.encode(message.longInitialMargin, writer.uint32(82).fork()).join();
1306
+ }
1307
+ if (message.shortInitialMargin !== undefined) {
1308
+ Money.encode(message.shortInitialMargin, writer.uint32(90).fork()).join();
1309
+ }
1310
+ if (message.isTradable !== undefined) {
1311
+ BoolValue.encode({ value: message.isTradable }, writer.uint32(98).fork()).join();
1312
+ }
1313
+ if (message.priceType !== 0) {
1314
+ writer.uint32(104).int32(message.priceType);
1315
+ }
1316
+ return writer;
1317
+ },
1318
+ decode(input, length) {
1319
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1320
+ const end = length === undefined ? reader.len : reader.pos + length;
1321
+ const message = createBaseGetAssetParamsResponse();
1322
+ while (reader.pos < end) {
1323
+ const tag = reader.uint32();
1324
+ switch (tag >>> 3) {
1325
+ case 1: {
1326
+ if (tag !== 10) {
1327
+ break;
1328
+ }
1329
+ message.symbol = reader.string();
1330
+ continue;
1331
+ }
1332
+ case 2: {
1333
+ if (tag !== 18) {
1334
+ break;
1335
+ }
1336
+ message.accountId = reader.string();
1337
+ continue;
1338
+ }
1339
+ case 3: {
1340
+ if (tag !== 24) {
1341
+ break;
1342
+ }
1343
+ message.tradeable = reader.bool();
1344
+ continue;
1345
+ }
1346
+ case 4: {
1347
+ if (tag !== 34) {
1348
+ break;
1349
+ }
1350
+ message.longable = Longable.decode(reader, reader.uint32());
1351
+ continue;
1352
+ }
1353
+ case 5: {
1354
+ if (tag !== 42) {
1355
+ break;
1356
+ }
1357
+ message.shortable = Shortable.decode(reader, reader.uint32());
1358
+ continue;
1359
+ }
1360
+ case 6: {
1361
+ if (tag !== 50) {
1362
+ break;
1363
+ }
1364
+ message.longRiskRate = Decimal.decode(reader, reader.uint32());
1365
+ continue;
1366
+ }
1367
+ case 7: {
1368
+ if (tag !== 58) {
1369
+ break;
1370
+ }
1371
+ message.longCollateral = Money.decode(reader, reader.uint32());
1372
+ continue;
1373
+ }
1374
+ case 8: {
1375
+ if (tag !== 66) {
1376
+ break;
1377
+ }
1378
+ message.shortRiskRate = Decimal.decode(reader, reader.uint32());
1379
+ continue;
1380
+ }
1381
+ case 9: {
1382
+ if (tag !== 74) {
1383
+ break;
1384
+ }
1385
+ message.shortCollateral = Money.decode(reader, reader.uint32());
1386
+ continue;
1387
+ }
1388
+ case 10: {
1389
+ if (tag !== 82) {
1390
+ break;
1391
+ }
1392
+ message.longInitialMargin = Money.decode(reader, reader.uint32());
1393
+ continue;
1394
+ }
1395
+ case 11: {
1396
+ if (tag !== 90) {
1397
+ break;
1398
+ }
1399
+ message.shortInitialMargin = Money.decode(reader, reader.uint32());
1400
+ continue;
1401
+ }
1402
+ case 12: {
1403
+ if (tag !== 98) {
1404
+ break;
1405
+ }
1406
+ message.isTradable = BoolValue.decode(reader, reader.uint32()).value;
1407
+ continue;
1408
+ }
1409
+ case 13: {
1410
+ if (tag !== 104) {
1411
+ break;
1412
+ }
1413
+ message.priceType = reader.int32();
1414
+ continue;
1415
+ }
1416
+ }
1417
+ if ((tag & 7) === 4 || tag === 0) {
1418
+ break;
1419
+ }
1420
+ reader.skip(tag & 7);
1421
+ }
1422
+ return message;
1423
+ },
1424
+ fromJSON(object) {
1425
+ return {
1426
+ symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : "",
1427
+ accountId: isSet(object.accountId)
1428
+ ? globalThis.String(object.accountId)
1429
+ : isSet(object.account_id)
1430
+ ? globalThis.String(object.account_id)
1431
+ : "",
1432
+ tradeable: isSet(object.tradeable) ? globalThis.Boolean(object.tradeable) : false,
1433
+ longable: isSet(object.longable) ? Longable.fromJSON(object.longable) : undefined,
1434
+ shortable: isSet(object.shortable) ? Shortable.fromJSON(object.shortable) : undefined,
1435
+ longRiskRate: isSet(object.longRiskRate)
1436
+ ? Decimal.fromJSON(object.longRiskRate)
1437
+ : isSet(object.long_risk_rate)
1438
+ ? Decimal.fromJSON(object.long_risk_rate)
1439
+ : undefined,
1440
+ longCollateral: isSet(object.longCollateral)
1441
+ ? Money.fromJSON(object.longCollateral)
1442
+ : isSet(object.long_collateral)
1443
+ ? Money.fromJSON(object.long_collateral)
1444
+ : undefined,
1445
+ shortRiskRate: isSet(object.shortRiskRate)
1446
+ ? Decimal.fromJSON(object.shortRiskRate)
1447
+ : isSet(object.short_risk_rate)
1448
+ ? Decimal.fromJSON(object.short_risk_rate)
1449
+ : undefined,
1450
+ shortCollateral: isSet(object.shortCollateral)
1451
+ ? Money.fromJSON(object.shortCollateral)
1452
+ : isSet(object.short_collateral)
1453
+ ? Money.fromJSON(object.short_collateral)
1454
+ : undefined,
1455
+ longInitialMargin: isSet(object.longInitialMargin)
1456
+ ? Money.fromJSON(object.longInitialMargin)
1457
+ : isSet(object.long_initial_margin)
1458
+ ? Money.fromJSON(object.long_initial_margin)
1459
+ : undefined,
1460
+ shortInitialMargin: isSet(object.shortInitialMargin)
1461
+ ? Money.fromJSON(object.shortInitialMargin)
1462
+ : isSet(object.short_initial_margin)
1463
+ ? Money.fromJSON(object.short_initial_margin)
1464
+ : undefined,
1465
+ isTradable: isSet(object.isTradable)
1466
+ ? Boolean(object.isTradable)
1467
+ : isSet(object.is_tradable)
1468
+ ? Boolean(object.is_tradable)
1469
+ : undefined,
1470
+ priceType: isSet(object.priceType)
1471
+ ? priceTypeFromJSON(object.priceType)
1472
+ : isSet(object.price_type)
1473
+ ? priceTypeFromJSON(object.price_type)
1474
+ : 0,
1475
+ };
1476
+ },
1477
+ toJSON(message) {
1478
+ const obj = {};
1479
+ if (message.symbol !== "") {
1480
+ obj.symbol = message.symbol;
1481
+ }
1482
+ if (message.accountId !== "") {
1483
+ obj.accountId = message.accountId;
1484
+ }
1485
+ if (message.tradeable !== false) {
1486
+ obj.tradeable = message.tradeable;
1487
+ }
1488
+ if (message.longable !== undefined) {
1489
+ obj.longable = Longable.toJSON(message.longable);
1490
+ }
1491
+ if (message.shortable !== undefined) {
1492
+ obj.shortable = Shortable.toJSON(message.shortable);
1493
+ }
1494
+ if (message.longRiskRate !== undefined) {
1495
+ obj.longRiskRate = Decimal.toJSON(message.longRiskRate);
1496
+ }
1497
+ if (message.longCollateral !== undefined) {
1498
+ obj.longCollateral = Money.toJSON(message.longCollateral);
1499
+ }
1500
+ if (message.shortRiskRate !== undefined) {
1501
+ obj.shortRiskRate = Decimal.toJSON(message.shortRiskRate);
1502
+ }
1503
+ if (message.shortCollateral !== undefined) {
1504
+ obj.shortCollateral = Money.toJSON(message.shortCollateral);
1505
+ }
1506
+ if (message.longInitialMargin !== undefined) {
1507
+ obj.longInitialMargin = Money.toJSON(message.longInitialMargin);
1508
+ }
1509
+ if (message.shortInitialMargin !== undefined) {
1510
+ obj.shortInitialMargin = Money.toJSON(message.shortInitialMargin);
1511
+ }
1512
+ if (message.isTradable !== undefined) {
1513
+ obj.isTradable = message.isTradable;
1514
+ }
1515
+ if (message.priceType !== 0) {
1516
+ obj.priceType = priceTypeToJSON(message.priceType);
1517
+ }
1518
+ return obj;
1519
+ },
1520
+ create(base) {
1521
+ return GetAssetParamsResponse.fromPartial(base ?? {});
1522
+ },
1523
+ fromPartial(object) {
1524
+ const message = createBaseGetAssetParamsResponse();
1525
+ message.symbol = object.symbol ?? "";
1526
+ message.accountId = object.accountId ?? "";
1527
+ message.tradeable = object.tradeable ?? false;
1528
+ message.longable = (object.longable !== undefined && object.longable !== null)
1529
+ ? Longable.fromPartial(object.longable)
1530
+ : undefined;
1531
+ message.shortable = (object.shortable !== undefined && object.shortable !== null)
1532
+ ? Shortable.fromPartial(object.shortable)
1533
+ : undefined;
1534
+ message.longRiskRate = (object.longRiskRate !== undefined && object.longRiskRate !== null)
1535
+ ? Decimal.fromPartial(object.longRiskRate)
1536
+ : undefined;
1537
+ message.longCollateral = (object.longCollateral !== undefined && object.longCollateral !== null)
1538
+ ? Money.fromPartial(object.longCollateral)
1539
+ : undefined;
1540
+ message.shortRiskRate = (object.shortRiskRate !== undefined && object.shortRiskRate !== null)
1541
+ ? Decimal.fromPartial(object.shortRiskRate)
1542
+ : undefined;
1543
+ message.shortCollateral = (object.shortCollateral !== undefined && object.shortCollateral !== null)
1544
+ ? Money.fromPartial(object.shortCollateral)
1545
+ : undefined;
1546
+ message.longInitialMargin = (object.longInitialMargin !== undefined && object.longInitialMargin !== null)
1547
+ ? Money.fromPartial(object.longInitialMargin)
1548
+ : undefined;
1549
+ message.shortInitialMargin = (object.shortInitialMargin !== undefined && object.shortInitialMargin !== null)
1550
+ ? Money.fromPartial(object.shortInitialMargin)
1551
+ : undefined;
1552
+ message.isTradable = object.isTradable ?? undefined;
1553
+ message.priceType = object.priceType ?? 0;
1554
+ return message;
1555
+ },
1556
+ };
1557
+ function createBaseOptionsChainRequest() {
1558
+ return { underlyingSymbol: "", root: "", expirationDate: undefined };
1559
+ }
1560
+ export const OptionsChainRequest = {
1561
+ encode(message, writer = new BinaryWriter()) {
1562
+ if (message.underlyingSymbol !== "") {
1563
+ writer.uint32(10).string(message.underlyingSymbol);
1564
+ }
1565
+ if (message.root !== "") {
1566
+ writer.uint32(18).string(message.root);
1567
+ }
1568
+ if (message.expirationDate !== undefined) {
1569
+ DateMessage.encode(message.expirationDate, writer.uint32(26).fork()).join();
1570
+ }
1571
+ return writer;
1572
+ },
1573
+ decode(input, length) {
1574
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1575
+ const end = length === undefined ? reader.len : reader.pos + length;
1576
+ const message = createBaseOptionsChainRequest();
1577
+ while (reader.pos < end) {
1578
+ const tag = reader.uint32();
1579
+ switch (tag >>> 3) {
1580
+ case 1: {
1581
+ if (tag !== 10) {
1582
+ break;
1583
+ }
1584
+ message.underlyingSymbol = reader.string();
1585
+ continue;
1586
+ }
1587
+ case 2: {
1588
+ if (tag !== 18) {
1589
+ break;
1590
+ }
1591
+ message.root = reader.string();
1592
+ continue;
1593
+ }
1594
+ case 3: {
1595
+ if (tag !== 26) {
1596
+ break;
1597
+ }
1598
+ message.expirationDate = DateMessage.decode(reader, reader.uint32());
1599
+ continue;
1600
+ }
1601
+ }
1602
+ if ((tag & 7) === 4 || tag === 0) {
1603
+ break;
1604
+ }
1605
+ reader.skip(tag & 7);
1606
+ }
1607
+ return message;
1608
+ },
1609
+ fromJSON(object) {
1610
+ return {
1611
+ underlyingSymbol: isSet(object.underlyingSymbol)
1612
+ ? globalThis.String(object.underlyingSymbol)
1613
+ : isSet(object.underlying_symbol)
1614
+ ? globalThis.String(object.underlying_symbol)
1615
+ : "",
1616
+ root: isSet(object.root) ? globalThis.String(object.root) : "",
1617
+ expirationDate: isSet(object.expirationDate)
1618
+ ? DateMessage.fromJSON(object.expirationDate)
1619
+ : isSet(object.expiration_date)
1620
+ ? DateMessage.fromJSON(object.expiration_date)
1621
+ : undefined,
1622
+ };
1623
+ },
1624
+ toJSON(message) {
1625
+ const obj = {};
1626
+ if (message.underlyingSymbol !== "") {
1627
+ obj.underlyingSymbol = message.underlyingSymbol;
1628
+ }
1629
+ if (message.root !== "") {
1630
+ obj.root = message.root;
1631
+ }
1632
+ if (message.expirationDate !== undefined) {
1633
+ obj.expirationDate = DateMessage.toJSON(message.expirationDate);
1634
+ }
1635
+ return obj;
1636
+ },
1637
+ create(base) {
1638
+ return OptionsChainRequest.fromPartial(base ?? {});
1639
+ },
1640
+ fromPartial(object) {
1641
+ const message = createBaseOptionsChainRequest();
1642
+ message.underlyingSymbol = object.underlyingSymbol ?? "";
1643
+ message.root = object.root ?? "";
1644
+ message.expirationDate = (object.expirationDate !== undefined && object.expirationDate !== null)
1645
+ ? DateMessage.fromPartial(object.expirationDate)
1646
+ : undefined;
1647
+ return message;
1648
+ },
1649
+ };
1650
+ function createBaseOptionsChainResponse() {
1651
+ return { symbol: "", options: [] };
1652
+ }
1653
+ export const OptionsChainResponse = {
1654
+ encode(message, writer = new BinaryWriter()) {
1655
+ if (message.symbol !== "") {
1656
+ writer.uint32(10).string(message.symbol);
1657
+ }
1658
+ for (const v of message.options) {
1659
+ Option.encode(v, writer.uint32(18).fork()).join();
1660
+ }
1661
+ return writer;
1662
+ },
1663
+ decode(input, length) {
1664
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1665
+ const end = length === undefined ? reader.len : reader.pos + length;
1666
+ const message = createBaseOptionsChainResponse();
1667
+ while (reader.pos < end) {
1668
+ const tag = reader.uint32();
1669
+ switch (tag >>> 3) {
1670
+ case 1: {
1671
+ if (tag !== 10) {
1672
+ break;
1673
+ }
1674
+ message.symbol = reader.string();
1675
+ continue;
1676
+ }
1677
+ case 2: {
1678
+ if (tag !== 18) {
1679
+ break;
1680
+ }
1681
+ message.options.push(Option.decode(reader, reader.uint32()));
1682
+ continue;
1683
+ }
1684
+ }
1685
+ if ((tag & 7) === 4 || tag === 0) {
1686
+ break;
1687
+ }
1688
+ reader.skip(tag & 7);
1689
+ }
1690
+ return message;
1691
+ },
1692
+ fromJSON(object) {
1693
+ return {
1694
+ symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : "",
1695
+ options: globalThis.Array.isArray(object?.options) ? object.options.map((e) => Option.fromJSON(e)) : [],
1696
+ };
1697
+ },
1698
+ toJSON(message) {
1699
+ const obj = {};
1700
+ if (message.symbol !== "") {
1701
+ obj.symbol = message.symbol;
1702
+ }
1703
+ if (message.options?.length) {
1704
+ obj.options = message.options.map((e) => Option.toJSON(e));
1705
+ }
1706
+ return obj;
1707
+ },
1708
+ create(base) {
1709
+ return OptionsChainResponse.fromPartial(base ?? {});
1710
+ },
1711
+ fromPartial(object) {
1712
+ const message = createBaseOptionsChainResponse();
1713
+ message.symbol = object.symbol ?? "";
1714
+ message.options = object.options?.map((e) => Option.fromPartial(e)) || [];
1715
+ return message;
1716
+ },
1717
+ };
1718
+ function createBaseScheduleRequest() {
1719
+ return { symbol: "" };
1720
+ }
1721
+ export const ScheduleRequest = {
1722
+ encode(message, writer = new BinaryWriter()) {
1723
+ if (message.symbol !== "") {
1724
+ writer.uint32(10).string(message.symbol);
1725
+ }
1726
+ return writer;
1727
+ },
1728
+ decode(input, length) {
1729
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1730
+ const end = length === undefined ? reader.len : reader.pos + length;
1731
+ const message = createBaseScheduleRequest();
1732
+ while (reader.pos < end) {
1733
+ const tag = reader.uint32();
1734
+ switch (tag >>> 3) {
1735
+ case 1: {
1736
+ if (tag !== 10) {
1737
+ break;
1738
+ }
1739
+ message.symbol = reader.string();
1740
+ continue;
1741
+ }
1742
+ }
1743
+ if ((tag & 7) === 4 || tag === 0) {
1744
+ break;
1745
+ }
1746
+ reader.skip(tag & 7);
1747
+ }
1748
+ return message;
1749
+ },
1750
+ fromJSON(object) {
1751
+ return { symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : "" };
1752
+ },
1753
+ toJSON(message) {
1754
+ const obj = {};
1755
+ if (message.symbol !== "") {
1756
+ obj.symbol = message.symbol;
1757
+ }
1758
+ return obj;
1759
+ },
1760
+ create(base) {
1761
+ return ScheduleRequest.fromPartial(base ?? {});
1762
+ },
1763
+ fromPartial(object) {
1764
+ const message = createBaseScheduleRequest();
1765
+ message.symbol = object.symbol ?? "";
1766
+ return message;
1767
+ },
1768
+ };
1769
+ function createBaseScheduleResponse() {
1770
+ return { symbol: "", sessions: [] };
1771
+ }
1772
+ export const ScheduleResponse = {
1773
+ encode(message, writer = new BinaryWriter()) {
1774
+ if (message.symbol !== "") {
1775
+ writer.uint32(10).string(message.symbol);
1776
+ }
1777
+ for (const v of message.sessions) {
1778
+ ScheduleResponse_Sessions.encode(v, writer.uint32(18).fork()).join();
1779
+ }
1780
+ return writer;
1781
+ },
1782
+ decode(input, length) {
1783
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1784
+ const end = length === undefined ? reader.len : reader.pos + length;
1785
+ const message = createBaseScheduleResponse();
1786
+ while (reader.pos < end) {
1787
+ const tag = reader.uint32();
1788
+ switch (tag >>> 3) {
1789
+ case 1: {
1790
+ if (tag !== 10) {
1791
+ break;
1792
+ }
1793
+ message.symbol = reader.string();
1794
+ continue;
1795
+ }
1796
+ case 2: {
1797
+ if (tag !== 18) {
1798
+ break;
1799
+ }
1800
+ message.sessions.push(ScheduleResponse_Sessions.decode(reader, reader.uint32()));
1801
+ continue;
1802
+ }
1803
+ }
1804
+ if ((tag & 7) === 4 || tag === 0) {
1805
+ break;
1806
+ }
1807
+ reader.skip(tag & 7);
1808
+ }
1809
+ return message;
1810
+ },
1811
+ fromJSON(object) {
1812
+ return {
1813
+ symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : "",
1814
+ sessions: globalThis.Array.isArray(object?.sessions)
1815
+ ? object.sessions.map((e) => ScheduleResponse_Sessions.fromJSON(e))
1816
+ : [],
1817
+ };
1818
+ },
1819
+ toJSON(message) {
1820
+ const obj = {};
1821
+ if (message.symbol !== "") {
1822
+ obj.symbol = message.symbol;
1823
+ }
1824
+ if (message.sessions?.length) {
1825
+ obj.sessions = message.sessions.map((e) => ScheduleResponse_Sessions.toJSON(e));
1826
+ }
1827
+ return obj;
1828
+ },
1829
+ create(base) {
1830
+ return ScheduleResponse.fromPartial(base ?? {});
1831
+ },
1832
+ fromPartial(object) {
1833
+ const message = createBaseScheduleResponse();
1834
+ message.symbol = object.symbol ?? "";
1835
+ message.sessions = object.sessions?.map((e) => ScheduleResponse_Sessions.fromPartial(e)) || [];
1836
+ return message;
1837
+ },
1838
+ };
1839
+ function createBaseScheduleResponse_Sessions() {
1840
+ return { type: "", interval: undefined };
1841
+ }
1842
+ export const ScheduleResponse_Sessions = {
1843
+ encode(message, writer = new BinaryWriter()) {
1844
+ if (message.type !== "") {
1845
+ writer.uint32(10).string(message.type);
1846
+ }
1847
+ if (message.interval !== undefined) {
1848
+ Interval.encode(message.interval, writer.uint32(18).fork()).join();
1849
+ }
1850
+ return writer;
1851
+ },
1852
+ decode(input, length) {
1853
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1854
+ const end = length === undefined ? reader.len : reader.pos + length;
1855
+ const message = createBaseScheduleResponse_Sessions();
1856
+ while (reader.pos < end) {
1857
+ const tag = reader.uint32();
1858
+ switch (tag >>> 3) {
1859
+ case 1: {
1860
+ if (tag !== 10) {
1861
+ break;
1862
+ }
1863
+ message.type = reader.string();
1864
+ continue;
1865
+ }
1866
+ case 2: {
1867
+ if (tag !== 18) {
1868
+ break;
1869
+ }
1870
+ message.interval = Interval.decode(reader, reader.uint32());
1871
+ continue;
1872
+ }
1873
+ }
1874
+ if ((tag & 7) === 4 || tag === 0) {
1875
+ break;
1876
+ }
1877
+ reader.skip(tag & 7);
1878
+ }
1879
+ return message;
1880
+ },
1881
+ fromJSON(object) {
1882
+ return {
1883
+ type: isSet(object.type) ? globalThis.String(object.type) : "",
1884
+ interval: isSet(object.interval) ? Interval.fromJSON(object.interval) : undefined,
1885
+ };
1886
+ },
1887
+ toJSON(message) {
1888
+ const obj = {};
1889
+ if (message.type !== "") {
1890
+ obj.type = message.type;
1891
+ }
1892
+ if (message.interval !== undefined) {
1893
+ obj.interval = Interval.toJSON(message.interval);
1894
+ }
1895
+ return obj;
1896
+ },
1897
+ create(base) {
1898
+ return ScheduleResponse_Sessions.fromPartial(base ?? {});
1899
+ },
1900
+ fromPartial(object) {
1901
+ const message = createBaseScheduleResponse_Sessions();
1902
+ message.type = object.type ?? "";
1903
+ message.interval = (object.interval !== undefined && object.interval !== null)
1904
+ ? Interval.fromPartial(object.interval)
1905
+ : undefined;
1906
+ return message;
1907
+ },
1908
+ };
1909
+ function createBaseClockRequest() {
1910
+ return {};
1911
+ }
1912
+ export const ClockRequest = {
1913
+ encode(_, writer = new BinaryWriter()) {
1914
+ return writer;
1915
+ },
1916
+ decode(input, length) {
1917
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1918
+ const end = length === undefined ? reader.len : reader.pos + length;
1919
+ const message = createBaseClockRequest();
1920
+ while (reader.pos < end) {
1921
+ const tag = reader.uint32();
1922
+ switch (tag >>> 3) {
1923
+ }
1924
+ if ((tag & 7) === 4 || tag === 0) {
1925
+ break;
1926
+ }
1927
+ reader.skip(tag & 7);
1928
+ }
1929
+ return message;
1930
+ },
1931
+ fromJSON(_) {
1932
+ return {};
1933
+ },
1934
+ toJSON(_) {
1935
+ const obj = {};
1936
+ return obj;
1937
+ },
1938
+ create(base) {
1939
+ return ClockRequest.fromPartial(base ?? {});
1940
+ },
1941
+ fromPartial(_) {
1942
+ const message = createBaseClockRequest();
1943
+ return message;
1944
+ },
1945
+ };
1946
+ function createBaseClockResponse() {
1947
+ return { timestamp: undefined };
1948
+ }
1949
+ export const ClockResponse = {
1950
+ encode(message, writer = new BinaryWriter()) {
1951
+ if (message.timestamp !== undefined) {
1952
+ Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(10).fork()).join();
1953
+ }
1954
+ return writer;
1955
+ },
1956
+ decode(input, length) {
1957
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1958
+ const end = length === undefined ? reader.len : reader.pos + length;
1959
+ const message = createBaseClockResponse();
1960
+ while (reader.pos < end) {
1961
+ const tag = reader.uint32();
1962
+ switch (tag >>> 3) {
1963
+ case 1: {
1964
+ if (tag !== 10) {
1965
+ break;
1966
+ }
1967
+ message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1968
+ continue;
1969
+ }
1970
+ }
1971
+ if ((tag & 7) === 4 || tag === 0) {
1972
+ break;
1973
+ }
1974
+ reader.skip(tag & 7);
1975
+ }
1976
+ return message;
1977
+ },
1978
+ fromJSON(object) {
1979
+ return { timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined };
1980
+ },
1981
+ toJSON(message) {
1982
+ const obj = {};
1983
+ if (message.timestamp !== undefined) {
1984
+ obj.timestamp = message.timestamp.toISOString();
1985
+ }
1986
+ return obj;
1987
+ },
1988
+ create(base) {
1989
+ return ClockResponse.fromPartial(base ?? {});
1990
+ },
1991
+ fromPartial(object) {
1992
+ const message = createBaseClockResponse();
1993
+ message.timestamp = object.timestamp ?? undefined;
1994
+ return message;
1995
+ },
1996
+ };
1997
+ function createBaseExchange() {
1998
+ return { mic: "", name: "" };
1999
+ }
2000
+ export const Exchange = {
2001
+ encode(message, writer = new BinaryWriter()) {
2002
+ if (message.mic !== "") {
2003
+ writer.uint32(10).string(message.mic);
2004
+ }
2005
+ if (message.name !== "") {
2006
+ writer.uint32(18).string(message.name);
2007
+ }
2008
+ return writer;
2009
+ },
2010
+ decode(input, length) {
2011
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2012
+ const end = length === undefined ? reader.len : reader.pos + length;
2013
+ const message = createBaseExchange();
2014
+ while (reader.pos < end) {
2015
+ const tag = reader.uint32();
2016
+ switch (tag >>> 3) {
2017
+ case 1: {
2018
+ if (tag !== 10) {
2019
+ break;
2020
+ }
2021
+ message.mic = reader.string();
2022
+ continue;
2023
+ }
2024
+ case 2: {
2025
+ if (tag !== 18) {
2026
+ break;
2027
+ }
2028
+ message.name = reader.string();
2029
+ continue;
2030
+ }
2031
+ }
2032
+ if ((tag & 7) === 4 || tag === 0) {
2033
+ break;
2034
+ }
2035
+ reader.skip(tag & 7);
2036
+ }
2037
+ return message;
2038
+ },
2039
+ fromJSON(object) {
2040
+ return {
2041
+ mic: isSet(object.mic) ? globalThis.String(object.mic) : "",
2042
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
2043
+ };
2044
+ },
2045
+ toJSON(message) {
2046
+ const obj = {};
2047
+ if (message.mic !== "") {
2048
+ obj.mic = message.mic;
2049
+ }
2050
+ if (message.name !== "") {
2051
+ obj.name = message.name;
2052
+ }
2053
+ return obj;
2054
+ },
2055
+ create(base) {
2056
+ return Exchange.fromPartial(base ?? {});
2057
+ },
2058
+ fromPartial(object) {
2059
+ const message = createBaseExchange();
2060
+ message.mic = object.mic ?? "";
2061
+ message.name = object.name ?? "";
2062
+ return message;
2063
+ },
2064
+ };
2065
+ function createBaseAsset() {
2066
+ return { symbol: "", id: "", ticker: "", mic: "", isin: "", type: "", name: "", isArchived: false };
2067
+ }
2068
+ export const Asset = {
2069
+ encode(message, writer = new BinaryWriter()) {
2070
+ if (message.symbol !== "") {
2071
+ writer.uint32(10).string(message.symbol);
2072
+ }
2073
+ if (message.id !== "") {
2074
+ writer.uint32(18).string(message.id);
2075
+ }
2076
+ if (message.ticker !== "") {
2077
+ writer.uint32(26).string(message.ticker);
2078
+ }
2079
+ if (message.mic !== "") {
2080
+ writer.uint32(34).string(message.mic);
2081
+ }
2082
+ if (message.isin !== "") {
2083
+ writer.uint32(42).string(message.isin);
2084
+ }
2085
+ if (message.type !== "") {
2086
+ writer.uint32(50).string(message.type);
2087
+ }
2088
+ if (message.name !== "") {
2089
+ writer.uint32(58).string(message.name);
2090
+ }
2091
+ if (message.isArchived !== false) {
2092
+ writer.uint32(64).bool(message.isArchived);
2093
+ }
2094
+ return writer;
2095
+ },
2096
+ decode(input, length) {
2097
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2098
+ const end = length === undefined ? reader.len : reader.pos + length;
2099
+ const message = createBaseAsset();
2100
+ while (reader.pos < end) {
2101
+ const tag = reader.uint32();
2102
+ switch (tag >>> 3) {
2103
+ case 1: {
2104
+ if (tag !== 10) {
2105
+ break;
2106
+ }
2107
+ message.symbol = reader.string();
2108
+ continue;
2109
+ }
2110
+ case 2: {
2111
+ if (tag !== 18) {
2112
+ break;
2113
+ }
2114
+ message.id = reader.string();
2115
+ continue;
2116
+ }
2117
+ case 3: {
2118
+ if (tag !== 26) {
2119
+ break;
2120
+ }
2121
+ message.ticker = reader.string();
2122
+ continue;
2123
+ }
2124
+ case 4: {
2125
+ if (tag !== 34) {
2126
+ break;
2127
+ }
2128
+ message.mic = reader.string();
2129
+ continue;
2130
+ }
2131
+ case 5: {
2132
+ if (tag !== 42) {
2133
+ break;
2134
+ }
2135
+ message.isin = reader.string();
2136
+ continue;
2137
+ }
2138
+ case 6: {
2139
+ if (tag !== 50) {
2140
+ break;
2141
+ }
2142
+ message.type = reader.string();
2143
+ continue;
2144
+ }
2145
+ case 7: {
2146
+ if (tag !== 58) {
2147
+ break;
2148
+ }
2149
+ message.name = reader.string();
2150
+ continue;
2151
+ }
2152
+ case 8: {
2153
+ if (tag !== 64) {
2154
+ break;
2155
+ }
2156
+ message.isArchived = reader.bool();
2157
+ continue;
2158
+ }
2159
+ }
2160
+ if ((tag & 7) === 4 || tag === 0) {
2161
+ break;
2162
+ }
2163
+ reader.skip(tag & 7);
2164
+ }
2165
+ return message;
2166
+ },
2167
+ fromJSON(object) {
2168
+ return {
2169
+ symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : "",
2170
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
2171
+ ticker: isSet(object.ticker) ? globalThis.String(object.ticker) : "",
2172
+ mic: isSet(object.mic) ? globalThis.String(object.mic) : "",
2173
+ isin: isSet(object.isin) ? globalThis.String(object.isin) : "",
2174
+ type: isSet(object.type) ? globalThis.String(object.type) : "",
2175
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
2176
+ isArchived: isSet(object.isArchived)
2177
+ ? globalThis.Boolean(object.isArchived)
2178
+ : isSet(object.is_archived)
2179
+ ? globalThis.Boolean(object.is_archived)
2180
+ : false,
2181
+ };
2182
+ },
2183
+ toJSON(message) {
2184
+ const obj = {};
2185
+ if (message.symbol !== "") {
2186
+ obj.symbol = message.symbol;
2187
+ }
2188
+ if (message.id !== "") {
2189
+ obj.id = message.id;
2190
+ }
2191
+ if (message.ticker !== "") {
2192
+ obj.ticker = message.ticker;
2193
+ }
2194
+ if (message.mic !== "") {
2195
+ obj.mic = message.mic;
2196
+ }
2197
+ if (message.isin !== "") {
2198
+ obj.isin = message.isin;
2199
+ }
2200
+ if (message.type !== "") {
2201
+ obj.type = message.type;
2202
+ }
2203
+ if (message.name !== "") {
2204
+ obj.name = message.name;
2205
+ }
2206
+ if (message.isArchived !== false) {
2207
+ obj.isArchived = message.isArchived;
2208
+ }
2209
+ return obj;
2210
+ },
2211
+ create(base) {
2212
+ return Asset.fromPartial(base ?? {});
2213
+ },
2214
+ fromPartial(object) {
2215
+ const message = createBaseAsset();
2216
+ message.symbol = object.symbol ?? "";
2217
+ message.id = object.id ?? "";
2218
+ message.ticker = object.ticker ?? "";
2219
+ message.mic = object.mic ?? "";
2220
+ message.isin = object.isin ?? "";
2221
+ message.type = object.type ?? "";
2222
+ message.name = object.name ?? "";
2223
+ message.isArchived = object.isArchived ?? false;
2224
+ return message;
2225
+ },
2226
+ };
2227
+ function createBaseOption() {
2228
+ return {
2229
+ symbol: "",
2230
+ type: 0,
2231
+ contractSize: undefined,
2232
+ tradeFirstDay: undefined,
2233
+ tradeLastDay: undefined,
2234
+ strike: undefined,
2235
+ multiplier: undefined,
2236
+ expirationFirstDay: undefined,
2237
+ expirationLastDay: undefined,
2238
+ };
2239
+ }
2240
+ export const Option = {
2241
+ encode(message, writer = new BinaryWriter()) {
2242
+ if (message.symbol !== "") {
2243
+ writer.uint32(10).string(message.symbol);
2244
+ }
2245
+ if (message.type !== 0) {
2246
+ writer.uint32(16).int32(message.type);
2247
+ }
2248
+ if (message.contractSize !== undefined) {
2249
+ Decimal.encode(message.contractSize, writer.uint32(34).fork()).join();
2250
+ }
2251
+ if (message.tradeFirstDay !== undefined) {
2252
+ DateMessage.encode(message.tradeFirstDay, writer.uint32(42).fork()).join();
2253
+ }
2254
+ if (message.tradeLastDay !== undefined) {
2255
+ DateMessage.encode(message.tradeLastDay, writer.uint32(50).fork()).join();
2256
+ }
2257
+ if (message.strike !== undefined) {
2258
+ Decimal.encode(message.strike, writer.uint32(58).fork()).join();
2259
+ }
2260
+ if (message.multiplier !== undefined) {
2261
+ Decimal.encode(message.multiplier, writer.uint32(74).fork()).join();
2262
+ }
2263
+ if (message.expirationFirstDay !== undefined) {
2264
+ DateMessage.encode(message.expirationFirstDay, writer.uint32(82).fork()).join();
2265
+ }
2266
+ if (message.expirationLastDay !== undefined) {
2267
+ DateMessage.encode(message.expirationLastDay, writer.uint32(90).fork()).join();
2268
+ }
2269
+ return writer;
2270
+ },
2271
+ decode(input, length) {
2272
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2273
+ const end = length === undefined ? reader.len : reader.pos + length;
2274
+ const message = createBaseOption();
2275
+ while (reader.pos < end) {
2276
+ const tag = reader.uint32();
2277
+ switch (tag >>> 3) {
2278
+ case 1: {
2279
+ if (tag !== 10) {
2280
+ break;
2281
+ }
2282
+ message.symbol = reader.string();
2283
+ continue;
2284
+ }
2285
+ case 2: {
2286
+ if (tag !== 16) {
2287
+ break;
2288
+ }
2289
+ message.type = reader.int32();
2290
+ continue;
2291
+ }
2292
+ case 4: {
2293
+ if (tag !== 34) {
2294
+ break;
2295
+ }
2296
+ message.contractSize = Decimal.decode(reader, reader.uint32());
2297
+ continue;
2298
+ }
2299
+ case 5: {
2300
+ if (tag !== 42) {
2301
+ break;
2302
+ }
2303
+ message.tradeFirstDay = DateMessage.decode(reader, reader.uint32());
2304
+ continue;
2305
+ }
2306
+ case 6: {
2307
+ if (tag !== 50) {
2308
+ break;
2309
+ }
2310
+ message.tradeLastDay = DateMessage.decode(reader, reader.uint32());
2311
+ continue;
2312
+ }
2313
+ case 7: {
2314
+ if (tag !== 58) {
2315
+ break;
2316
+ }
2317
+ message.strike = Decimal.decode(reader, reader.uint32());
2318
+ continue;
2319
+ }
2320
+ case 9: {
2321
+ if (tag !== 74) {
2322
+ break;
2323
+ }
2324
+ message.multiplier = Decimal.decode(reader, reader.uint32());
2325
+ continue;
2326
+ }
2327
+ case 10: {
2328
+ if (tag !== 82) {
2329
+ break;
2330
+ }
2331
+ message.expirationFirstDay = DateMessage.decode(reader, reader.uint32());
2332
+ continue;
2333
+ }
2334
+ case 11: {
2335
+ if (tag !== 90) {
2336
+ break;
2337
+ }
2338
+ message.expirationLastDay = DateMessage.decode(reader, reader.uint32());
2339
+ continue;
2340
+ }
2341
+ }
2342
+ if ((tag & 7) === 4 || tag === 0) {
2343
+ break;
2344
+ }
2345
+ reader.skip(tag & 7);
2346
+ }
2347
+ return message;
2348
+ },
2349
+ fromJSON(object) {
2350
+ return {
2351
+ symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : "",
2352
+ type: isSet(object.type) ? option_TypeFromJSON(object.type) : 0,
2353
+ contractSize: isSet(object.contractSize)
2354
+ ? Decimal.fromJSON(object.contractSize)
2355
+ : isSet(object.contract_size)
2356
+ ? Decimal.fromJSON(object.contract_size)
2357
+ : undefined,
2358
+ tradeFirstDay: isSet(object.tradeFirstDay)
2359
+ ? DateMessage.fromJSON(object.tradeFirstDay)
2360
+ : isSet(object.trade_first_day)
2361
+ ? DateMessage.fromJSON(object.trade_first_day)
2362
+ : undefined,
2363
+ tradeLastDay: isSet(object.tradeLastDay)
2364
+ ? DateMessage.fromJSON(object.tradeLastDay)
2365
+ : isSet(object.trade_last_day)
2366
+ ? DateMessage.fromJSON(object.trade_last_day)
2367
+ : undefined,
2368
+ strike: isSet(object.strike) ? Decimal.fromJSON(object.strike) : undefined,
2369
+ multiplier: isSet(object.multiplier) ? Decimal.fromJSON(object.multiplier) : undefined,
2370
+ expirationFirstDay: isSet(object.expirationFirstDay)
2371
+ ? DateMessage.fromJSON(object.expirationFirstDay)
2372
+ : isSet(object.expiration_first_day)
2373
+ ? DateMessage.fromJSON(object.expiration_first_day)
2374
+ : undefined,
2375
+ expirationLastDay: isSet(object.expirationLastDay)
2376
+ ? DateMessage.fromJSON(object.expirationLastDay)
2377
+ : isSet(object.expiration_last_day)
2378
+ ? DateMessage.fromJSON(object.expiration_last_day)
2379
+ : undefined,
2380
+ };
2381
+ },
2382
+ toJSON(message) {
2383
+ const obj = {};
2384
+ if (message.symbol !== "") {
2385
+ obj.symbol = message.symbol;
2386
+ }
2387
+ if (message.type !== 0) {
2388
+ obj.type = option_TypeToJSON(message.type);
2389
+ }
2390
+ if (message.contractSize !== undefined) {
2391
+ obj.contractSize = Decimal.toJSON(message.contractSize);
2392
+ }
2393
+ if (message.tradeFirstDay !== undefined) {
2394
+ obj.tradeFirstDay = DateMessage.toJSON(message.tradeFirstDay);
2395
+ }
2396
+ if (message.tradeLastDay !== undefined) {
2397
+ obj.tradeLastDay = DateMessage.toJSON(message.tradeLastDay);
2398
+ }
2399
+ if (message.strike !== undefined) {
2400
+ obj.strike = Decimal.toJSON(message.strike);
2401
+ }
2402
+ if (message.multiplier !== undefined) {
2403
+ obj.multiplier = Decimal.toJSON(message.multiplier);
2404
+ }
2405
+ if (message.expirationFirstDay !== undefined) {
2406
+ obj.expirationFirstDay = DateMessage.toJSON(message.expirationFirstDay);
2407
+ }
2408
+ if (message.expirationLastDay !== undefined) {
2409
+ obj.expirationLastDay = DateMessage.toJSON(message.expirationLastDay);
2410
+ }
2411
+ return obj;
2412
+ },
2413
+ create(base) {
2414
+ return Option.fromPartial(base ?? {});
2415
+ },
2416
+ fromPartial(object) {
2417
+ const message = createBaseOption();
2418
+ message.symbol = object.symbol ?? "";
2419
+ message.type = object.type ?? 0;
2420
+ message.contractSize = (object.contractSize !== undefined && object.contractSize !== null)
2421
+ ? Decimal.fromPartial(object.contractSize)
2422
+ : undefined;
2423
+ message.tradeFirstDay = (object.tradeFirstDay !== undefined && object.tradeFirstDay !== null)
2424
+ ? DateMessage.fromPartial(object.tradeFirstDay)
2425
+ : undefined;
2426
+ message.tradeLastDay = (object.tradeLastDay !== undefined && object.tradeLastDay !== null)
2427
+ ? DateMessage.fromPartial(object.tradeLastDay)
2428
+ : undefined;
2429
+ message.strike = (object.strike !== undefined && object.strike !== null)
2430
+ ? Decimal.fromPartial(object.strike)
2431
+ : undefined;
2432
+ message.multiplier = (object.multiplier !== undefined && object.multiplier !== null)
2433
+ ? Decimal.fromPartial(object.multiplier)
2434
+ : undefined;
2435
+ message.expirationFirstDay = (object.expirationFirstDay !== undefined && object.expirationFirstDay !== null)
2436
+ ? DateMessage.fromPartial(object.expirationFirstDay)
2437
+ : undefined;
2438
+ message.expirationLastDay = (object.expirationLastDay !== undefined && object.expirationLastDay !== null)
2439
+ ? DateMessage.fromPartial(object.expirationLastDay)
2440
+ : undefined;
2441
+ return message;
2442
+ },
2443
+ };
2444
+ function createBaseLongable() {
2445
+ return { value: 0, haltedDays: 0 };
2446
+ }
2447
+ export const Longable = {
2448
+ encode(message, writer = new BinaryWriter()) {
2449
+ if (message.value !== 0) {
2450
+ writer.uint32(8).int32(message.value);
2451
+ }
2452
+ if (message.haltedDays !== 0) {
2453
+ writer.uint32(16).int32(message.haltedDays);
2454
+ }
2455
+ return writer;
2456
+ },
2457
+ decode(input, length) {
2458
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2459
+ const end = length === undefined ? reader.len : reader.pos + length;
2460
+ const message = createBaseLongable();
2461
+ while (reader.pos < end) {
2462
+ const tag = reader.uint32();
2463
+ switch (tag >>> 3) {
2464
+ case 1: {
2465
+ if (tag !== 8) {
2466
+ break;
2467
+ }
2468
+ message.value = reader.int32();
2469
+ continue;
2470
+ }
2471
+ case 2: {
2472
+ if (tag !== 16) {
2473
+ break;
2474
+ }
2475
+ message.haltedDays = reader.int32();
2476
+ continue;
2477
+ }
2478
+ }
2479
+ if ((tag & 7) === 4 || tag === 0) {
2480
+ break;
2481
+ }
2482
+ reader.skip(tag & 7);
2483
+ }
2484
+ return message;
2485
+ },
2486
+ fromJSON(object) {
2487
+ return {
2488
+ value: isSet(object.value) ? longable_StatusFromJSON(object.value) : 0,
2489
+ haltedDays: isSet(object.haltedDays)
2490
+ ? globalThis.Number(object.haltedDays)
2491
+ : isSet(object.halted_days)
2492
+ ? globalThis.Number(object.halted_days)
2493
+ : 0,
2494
+ };
2495
+ },
2496
+ toJSON(message) {
2497
+ const obj = {};
2498
+ if (message.value !== 0) {
2499
+ obj.value = longable_StatusToJSON(message.value);
2500
+ }
2501
+ if (message.haltedDays !== 0) {
2502
+ obj.haltedDays = Math.round(message.haltedDays);
2503
+ }
2504
+ return obj;
2505
+ },
2506
+ create(base) {
2507
+ return Longable.fromPartial(base ?? {});
2508
+ },
2509
+ fromPartial(object) {
2510
+ const message = createBaseLongable();
2511
+ message.value = object.value ?? 0;
2512
+ message.haltedDays = object.haltedDays ?? 0;
2513
+ return message;
2514
+ },
2515
+ };
2516
+ function createBaseShortable() {
2517
+ return { value: 0, haltedDays: 0 };
2518
+ }
2519
+ export const Shortable = {
2520
+ encode(message, writer = new BinaryWriter()) {
2521
+ if (message.value !== 0) {
2522
+ writer.uint32(8).int32(message.value);
2523
+ }
2524
+ if (message.haltedDays !== 0) {
2525
+ writer.uint32(16).int32(message.haltedDays);
2526
+ }
2527
+ return writer;
2528
+ },
2529
+ decode(input, length) {
2530
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2531
+ const end = length === undefined ? reader.len : reader.pos + length;
2532
+ const message = createBaseShortable();
2533
+ while (reader.pos < end) {
2534
+ const tag = reader.uint32();
2535
+ switch (tag >>> 3) {
2536
+ case 1: {
2537
+ if (tag !== 8) {
2538
+ break;
2539
+ }
2540
+ message.value = reader.int32();
2541
+ continue;
2542
+ }
2543
+ case 2: {
2544
+ if (tag !== 16) {
2545
+ break;
2546
+ }
2547
+ message.haltedDays = reader.int32();
2548
+ continue;
2549
+ }
2550
+ }
2551
+ if ((tag & 7) === 4 || tag === 0) {
2552
+ break;
2553
+ }
2554
+ reader.skip(tag & 7);
2555
+ }
2556
+ return message;
2557
+ },
2558
+ fromJSON(object) {
2559
+ return {
2560
+ value: isSet(object.value) ? shortable_StatusFromJSON(object.value) : 0,
2561
+ haltedDays: isSet(object.haltedDays)
2562
+ ? globalThis.Number(object.haltedDays)
2563
+ : isSet(object.halted_days)
2564
+ ? globalThis.Number(object.halted_days)
2565
+ : 0,
2566
+ };
2567
+ },
2568
+ toJSON(message) {
2569
+ const obj = {};
2570
+ if (message.value !== 0) {
2571
+ obj.value = shortable_StatusToJSON(message.value);
2572
+ }
2573
+ if (message.haltedDays !== 0) {
2574
+ obj.haltedDays = Math.round(message.haltedDays);
2575
+ }
2576
+ return obj;
2577
+ },
2578
+ create(base) {
2579
+ return Shortable.fromPartial(base ?? {});
2580
+ },
2581
+ fromPartial(object) {
2582
+ const message = createBaseShortable();
2583
+ message.value = object.value ?? 0;
2584
+ message.haltedDays = object.haltedDays ?? 0;
2585
+ return message;
2586
+ },
2587
+ };
2588
+ function createBaseGetConstituentsRequest() {
2589
+ return { symbol: "", cursor: 0n };
2590
+ }
2591
+ export const GetConstituentsRequest = {
2592
+ encode(message, writer = new BinaryWriter()) {
2593
+ if (message.symbol !== "") {
2594
+ writer.uint32(10).string(message.symbol);
2595
+ }
2596
+ if (message.cursor !== 0n) {
2597
+ if (BigInt.asIntN(64, message.cursor) !== message.cursor) {
2598
+ throw new globalThis.Error("value provided for field message.cursor of type int64 too large");
2599
+ }
2600
+ writer.uint32(16).int64(message.cursor);
2601
+ }
2602
+ return writer;
2603
+ },
2604
+ decode(input, length) {
2605
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2606
+ const end = length === undefined ? reader.len : reader.pos + length;
2607
+ const message = createBaseGetConstituentsRequest();
2608
+ while (reader.pos < end) {
2609
+ const tag = reader.uint32();
2610
+ switch (tag >>> 3) {
2611
+ case 1: {
2612
+ if (tag !== 10) {
2613
+ break;
2614
+ }
2615
+ message.symbol = reader.string();
2616
+ continue;
2617
+ }
2618
+ case 2: {
2619
+ if (tag !== 16) {
2620
+ break;
2621
+ }
2622
+ message.cursor = reader.int64();
2623
+ continue;
2624
+ }
2625
+ }
2626
+ if ((tag & 7) === 4 || tag === 0) {
2627
+ break;
2628
+ }
2629
+ reader.skip(tag & 7);
2630
+ }
2631
+ return message;
2632
+ },
2633
+ fromJSON(object) {
2634
+ return {
2635
+ symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : "",
2636
+ cursor: isSet(object.cursor) ? BigInt(object.cursor) : 0n,
2637
+ };
2638
+ },
2639
+ toJSON(message) {
2640
+ const obj = {};
2641
+ if (message.symbol !== "") {
2642
+ obj.symbol = message.symbol;
2643
+ }
2644
+ if (message.cursor !== 0n) {
2645
+ obj.cursor = message.cursor.toString();
2646
+ }
2647
+ return obj;
2648
+ },
2649
+ create(base) {
2650
+ return GetConstituentsRequest.fromPartial(base ?? {});
2651
+ },
2652
+ fromPartial(object) {
2653
+ const message = createBaseGetConstituentsRequest();
2654
+ message.symbol = object.symbol ?? "";
2655
+ message.cursor = (object.cursor !== undefined && object.cursor !== null) ? BigInt(object.cursor) : 0n;
2656
+ return message;
2657
+ },
2658
+ };
2659
+ function createBaseGetConstituentsResponse() {
2660
+ return { constituents: [], nextCursor: 0n };
2661
+ }
2662
+ export const GetConstituentsResponse = {
2663
+ encode(message, writer = new BinaryWriter()) {
2664
+ for (const v of message.constituents) {
2665
+ Constituents.encode(v, writer.uint32(10).fork()).join();
2666
+ }
2667
+ if (message.nextCursor !== 0n) {
2668
+ if (BigInt.asIntN(64, message.nextCursor) !== message.nextCursor) {
2669
+ throw new globalThis.Error("value provided for field message.nextCursor of type int64 too large");
2670
+ }
2671
+ writer.uint32(16).int64(message.nextCursor);
2672
+ }
2673
+ return writer;
2674
+ },
2675
+ decode(input, length) {
2676
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2677
+ const end = length === undefined ? reader.len : reader.pos + length;
2678
+ const message = createBaseGetConstituentsResponse();
2679
+ while (reader.pos < end) {
2680
+ const tag = reader.uint32();
2681
+ switch (tag >>> 3) {
2682
+ case 1: {
2683
+ if (tag !== 10) {
2684
+ break;
2685
+ }
2686
+ message.constituents.push(Constituents.decode(reader, reader.uint32()));
2687
+ continue;
2688
+ }
2689
+ case 2: {
2690
+ if (tag !== 16) {
2691
+ break;
2692
+ }
2693
+ message.nextCursor = reader.int64();
2694
+ continue;
2695
+ }
2696
+ }
2697
+ if ((tag & 7) === 4 || tag === 0) {
2698
+ break;
2699
+ }
2700
+ reader.skip(tag & 7);
2701
+ }
2702
+ return message;
2703
+ },
2704
+ fromJSON(object) {
2705
+ return {
2706
+ constituents: globalThis.Array.isArray(object?.constituents)
2707
+ ? object.constituents.map((e) => Constituents.fromJSON(e))
2708
+ : [],
2709
+ nextCursor: isSet(object.nextCursor)
2710
+ ? BigInt(object.nextCursor)
2711
+ : isSet(object.next_cursor)
2712
+ ? BigInt(object.next_cursor)
2713
+ : 0n,
2714
+ };
2715
+ },
2716
+ toJSON(message) {
2717
+ const obj = {};
2718
+ if (message.constituents?.length) {
2719
+ obj.constituents = message.constituents.map((e) => Constituents.toJSON(e));
2720
+ }
2721
+ if (message.nextCursor !== 0n) {
2722
+ obj.nextCursor = message.nextCursor.toString();
2723
+ }
2724
+ return obj;
2725
+ },
2726
+ create(base) {
2727
+ return GetConstituentsResponse.fromPartial(base ?? {});
2728
+ },
2729
+ fromPartial(object) {
2730
+ const message = createBaseGetConstituentsResponse();
2731
+ message.constituents = object.constituents?.map((e) => Constituents.fromPartial(e)) || [];
2732
+ message.nextCursor = (object.nextCursor !== undefined && object.nextCursor !== null)
2733
+ ? BigInt(object.nextCursor)
2734
+ : 0n;
2735
+ return message;
2736
+ },
2737
+ };
2738
+ function createBaseConstituents() {
2739
+ return { symbol: "", name: "", sector: "", subSector: "", cik: "", indexInclusionDate: undefined, weight: undefined };
2740
+ }
2741
+ export const Constituents = {
2742
+ encode(message, writer = new BinaryWriter()) {
2743
+ if (message.symbol !== "") {
2744
+ writer.uint32(10).string(message.symbol);
2745
+ }
2746
+ if (message.name !== "") {
2747
+ writer.uint32(18).string(message.name);
2748
+ }
2749
+ if (message.sector !== "") {
2750
+ writer.uint32(26).string(message.sector);
2751
+ }
2752
+ if (message.subSector !== "") {
2753
+ writer.uint32(34).string(message.subSector);
2754
+ }
2755
+ if (message.cik !== "") {
2756
+ writer.uint32(42).string(message.cik);
2757
+ }
2758
+ if (message.indexInclusionDate !== undefined) {
2759
+ DateMessage.encode(message.indexInclusionDate, writer.uint32(50).fork()).join();
2760
+ }
2761
+ if (message.weight !== undefined) {
2762
+ Decimal.encode(message.weight, writer.uint32(58).fork()).join();
2763
+ }
2764
+ return writer;
2765
+ },
2766
+ decode(input, length) {
2767
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2768
+ const end = length === undefined ? reader.len : reader.pos + length;
2769
+ const message = createBaseConstituents();
2770
+ while (reader.pos < end) {
2771
+ const tag = reader.uint32();
2772
+ switch (tag >>> 3) {
2773
+ case 1: {
2774
+ if (tag !== 10) {
2775
+ break;
2776
+ }
2777
+ message.symbol = reader.string();
2778
+ continue;
2779
+ }
2780
+ case 2: {
2781
+ if (tag !== 18) {
2782
+ break;
2783
+ }
2784
+ message.name = reader.string();
2785
+ continue;
2786
+ }
2787
+ case 3: {
2788
+ if (tag !== 26) {
2789
+ break;
2790
+ }
2791
+ message.sector = reader.string();
2792
+ continue;
2793
+ }
2794
+ case 4: {
2795
+ if (tag !== 34) {
2796
+ break;
2797
+ }
2798
+ message.subSector = reader.string();
2799
+ continue;
2800
+ }
2801
+ case 5: {
2802
+ if (tag !== 42) {
2803
+ break;
2804
+ }
2805
+ message.cik = reader.string();
2806
+ continue;
2807
+ }
2808
+ case 6: {
2809
+ if (tag !== 50) {
2810
+ break;
2811
+ }
2812
+ message.indexInclusionDate = DateMessage.decode(reader, reader.uint32());
2813
+ continue;
2814
+ }
2815
+ case 7: {
2816
+ if (tag !== 58) {
2817
+ break;
2818
+ }
2819
+ message.weight = Decimal.decode(reader, reader.uint32());
2820
+ continue;
2821
+ }
2822
+ }
2823
+ if ((tag & 7) === 4 || tag === 0) {
2824
+ break;
2825
+ }
2826
+ reader.skip(tag & 7);
2827
+ }
2828
+ return message;
2829
+ },
2830
+ fromJSON(object) {
2831
+ return {
2832
+ symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : "",
2833
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
2834
+ sector: isSet(object.sector) ? globalThis.String(object.sector) : "",
2835
+ subSector: isSet(object.subSector)
2836
+ ? globalThis.String(object.subSector)
2837
+ : isSet(object.sub_sector)
2838
+ ? globalThis.String(object.sub_sector)
2839
+ : "",
2840
+ cik: isSet(object.cik) ? globalThis.String(object.cik) : "",
2841
+ indexInclusionDate: isSet(object.indexInclusionDate)
2842
+ ? DateMessage.fromJSON(object.indexInclusionDate)
2843
+ : isSet(object.index_inclusion_date)
2844
+ ? DateMessage.fromJSON(object.index_inclusion_date)
2845
+ : undefined,
2846
+ weight: isSet(object.weight) ? Decimal.fromJSON(object.weight) : undefined,
2847
+ };
2848
+ },
2849
+ toJSON(message) {
2850
+ const obj = {};
2851
+ if (message.symbol !== "") {
2852
+ obj.symbol = message.symbol;
2853
+ }
2854
+ if (message.name !== "") {
2855
+ obj.name = message.name;
2856
+ }
2857
+ if (message.sector !== "") {
2858
+ obj.sector = message.sector;
2859
+ }
2860
+ if (message.subSector !== "") {
2861
+ obj.subSector = message.subSector;
2862
+ }
2863
+ if (message.cik !== "") {
2864
+ obj.cik = message.cik;
2865
+ }
2866
+ if (message.indexInclusionDate !== undefined) {
2867
+ obj.indexInclusionDate = DateMessage.toJSON(message.indexInclusionDate);
2868
+ }
2869
+ if (message.weight !== undefined) {
2870
+ obj.weight = Decimal.toJSON(message.weight);
2871
+ }
2872
+ return obj;
2873
+ },
2874
+ create(base) {
2875
+ return Constituents.fromPartial(base ?? {});
2876
+ },
2877
+ fromPartial(object) {
2878
+ const message = createBaseConstituents();
2879
+ message.symbol = object.symbol ?? "";
2880
+ message.name = object.name ?? "";
2881
+ message.sector = object.sector ?? "";
2882
+ message.subSector = object.subSector ?? "";
2883
+ message.cik = object.cik ?? "";
2884
+ message.indexInclusionDate = (object.indexInclusionDate !== undefined && object.indexInclusionDate !== null)
2885
+ ? DateMessage.fromPartial(object.indexInclusionDate)
2886
+ : undefined;
2887
+ message.weight = (object.weight !== undefined && object.weight !== null)
2888
+ ? Decimal.fromPartial(object.weight)
2889
+ : undefined;
2890
+ return message;
2891
+ },
2892
+ };
2893
+ export const AssetsServiceDefinition = {
2894
+ name: "AssetsService",
2895
+ fullName: "grpc.tradeapi.v1.assets.AssetsService",
2896
+ methods: {
2897
+ /**
2898
+ * Get available exchanges, names, and MIC codes
2899
+ * Example HTTP request:
2900
+ * GET /v1/exchanges
2901
+ * Authorization: <token>
2902
+ */
2903
+ exchanges: {
2904
+ name: "Exchanges",
2905
+ requestType: ExchangesRequest,
2906
+ requestStream: false,
2907
+ responseType: ExchangesResponse,
2908
+ responseStream: false,
2909
+ options: {
2910
+ _unknownFields: {
2911
+ 8338: [
2912
+ new Uint8Array([
2913
+ 21,
2914
+ 98,
2915
+ 19,
2916
+ 10,
2917
+ 17,
2918
+ 10,
2919
+ 13,
2920
+ 65,
2921
+ 117,
2922
+ 116,
2923
+ 104,
2924
+ 111,
2925
+ 114,
2926
+ 105,
2927
+ 122,
2928
+ 97,
2929
+ 116,
2930
+ 105,
2931
+ 111,
2932
+ 110,
2933
+ 18,
2934
+ 0,
2935
+ ]),
2936
+ ],
2937
+ 578365826: [
2938
+ new Uint8Array([15, 18, 13, 47, 118, 49, 47, 101, 120, 99, 104, 97, 110, 103, 101, 115]),
2939
+ ],
2940
+ },
2941
+ },
2942
+ },
2943
+ /**
2944
+ * Get instruments available for trading and their descriptions
2945
+ * Example HTTP request:
2946
+ * GET /v1/assets
2947
+ * Authorization: <token>
2948
+ *
2949
+ * @deprecated
2950
+ */
2951
+ assets: {
2952
+ name: "Assets",
2953
+ requestType: AssetsRequest,
2954
+ requestStream: false,
2955
+ responseType: AssetsResponse,
2956
+ responseStream: false,
2957
+ options: {
2958
+ _unknownFields: {
2959
+ 8338: [
2960
+ new Uint8Array([
2961
+ 21,
2962
+ 98,
2963
+ 19,
2964
+ 10,
2965
+ 17,
2966
+ 10,
2967
+ 13,
2968
+ 65,
2969
+ 117,
2970
+ 116,
2971
+ 104,
2972
+ 111,
2973
+ 114,
2974
+ 105,
2975
+ 122,
2976
+ 97,
2977
+ 116,
2978
+ 105,
2979
+ 111,
2980
+ 110,
2981
+ 18,
2982
+ 0,
2983
+ ]),
2984
+ ],
2985
+ 578365826: [new Uint8Array([12, 18, 10, 47, 118, 49, 47, 97, 115, 115, 101, 116, 115])],
2986
+ },
2987
+ },
2988
+ },
2989
+ /**
2990
+ * Get all instruments, including indicative and archived instruments, and their descriptions
2991
+ * Example HTTP request:
2992
+ * GET /v1/assets/all?cursor=56658&only_disabled=true
2993
+ * Authorization: <token>
2994
+ */
2995
+ allAssets: {
2996
+ name: "AllAssets",
2997
+ requestType: AllAssetsRequest,
2998
+ requestStream: false,
2999
+ responseType: AllAssetsResponse,
3000
+ responseStream: false,
3001
+ options: {
3002
+ _unknownFields: {
3003
+ 8338: [
3004
+ new Uint8Array([
3005
+ 21,
3006
+ 98,
3007
+ 19,
3008
+ 10,
3009
+ 17,
3010
+ 10,
3011
+ 13,
3012
+ 65,
3013
+ 117,
3014
+ 116,
3015
+ 104,
3016
+ 111,
3017
+ 114,
3018
+ 105,
3019
+ 122,
3020
+ 97,
3021
+ 116,
3022
+ 105,
3023
+ 111,
3024
+ 110,
3025
+ 18,
3026
+ 0,
3027
+ ]),
3028
+ ],
3029
+ 578365826: [
3030
+ new Uint8Array([16, 18, 14, 47, 118, 49, 47, 97, 115, 115, 101, 116, 115, 47, 97, 108, 108]),
3031
+ ],
3032
+ },
3033
+ },
3034
+ },
3035
+ /**
3036
+ * Get information about a specific instrument
3037
+ * Example HTTP request:
3038
+ * GET /v1/assets/SBER@MISX?account_id=1440399
3039
+ * Authorization: <token>
3040
+ *
3041
+ * Parameters:
3042
+ * - symbol is passed in the URL path
3043
+ * - account_id is passed as a query parameter
3044
+ */
3045
+ getAsset: {
3046
+ name: "GetAsset",
3047
+ requestType: GetAssetRequest,
3048
+ requestStream: false,
3049
+ responseType: GetAssetResponse,
3050
+ responseStream: false,
3051
+ options: {
3052
+ _unknownFields: {
3053
+ 8338: [
3054
+ new Uint8Array([
3055
+ 120,
3056
+ 74,
3057
+ 97,
3058
+ 10,
3059
+ 3,
3060
+ 52,
3061
+ 48,
3062
+ 48,
3063
+ 18,
3064
+ 90,
3065
+ 10,
3066
+ 88,
3067
+ 73,
3068
+ 110,
3069
+ 118,
3070
+ 97,
3071
+ 108,
3072
+ 105,
3073
+ 100,
3074
+ 32,
3075
+ 115,
3076
+ 121,
3077
+ 109,
3078
+ 98,
3079
+ 111,
3080
+ 108,
3081
+ 32,
3082
+ 111,
3083
+ 114,
3084
+ 32,
3085
+ 97,
3086
+ 99,
3087
+ 99,
3088
+ 111,
3089
+ 117,
3090
+ 110,
3091
+ 116,
3092
+ 46,
3093
+ 32,
3094
+ 84,
3095
+ 104,
3096
+ 101,
3097
+ 32,
3098
+ 115,
3099
+ 121,
3100
+ 109,
3101
+ 98,
3102
+ 111,
3103
+ 108,
3104
+ 32,
3105
+ 109,
3106
+ 117,
3107
+ 115,
3108
+ 116,
3109
+ 32,
3110
+ 117,
3111
+ 115,
3112
+ 101,
3113
+ 32,
3114
+ 116,
3115
+ 105,
3116
+ 99,
3117
+ 107,
3118
+ 101,
3119
+ 114,
3120
+ 64,
3121
+ 109,
3122
+ 105,
3123
+ 99,
3124
+ 32,
3125
+ 102,
3126
+ 111,
3127
+ 114,
3128
+ 109,
3129
+ 97,
3130
+ 116,
3131
+ 44,
3132
+ 32,
3133
+ 102,
3134
+ 111,
3135
+ 114,
3136
+ 32,
3137
+ 101,
3138
+ 120,
3139
+ 97,
3140
+ 109,
3141
+ 112,
3142
+ 108,
3143
+ 101,
3144
+ 32,
3145
+ 83,
3146
+ 66,
3147
+ 69,
3148
+ 82,
3149
+ 64,
3150
+ 77,
3151
+ 73,
3152
+ 83,
3153
+ 88,
3154
+ 46,
3155
+ 98,
3156
+ 19,
3157
+ 10,
3158
+ 17,
3159
+ 10,
3160
+ 13,
3161
+ 65,
3162
+ 117,
3163
+ 116,
3164
+ 104,
3165
+ 111,
3166
+ 114,
3167
+ 105,
3168
+ 122,
3169
+ 97,
3170
+ 116,
3171
+ 105,
3172
+ 111,
3173
+ 110,
3174
+ 18,
3175
+ 0,
3176
+ ]),
3177
+ ],
3178
+ 578365826: [
3179
+ new Uint8Array([
3180
+ 21,
3181
+ 18,
3182
+ 19,
3183
+ 47,
3184
+ 118,
3185
+ 49,
3186
+ 47,
3187
+ 97,
3188
+ 115,
3189
+ 115,
3190
+ 101,
3191
+ 116,
3192
+ 115,
3193
+ 47,
3194
+ 123,
3195
+ 115,
3196
+ 121,
3197
+ 109,
3198
+ 98,
3199
+ 111,
3200
+ 108,
3201
+ 125,
3202
+ ]),
3203
+ ],
3204
+ },
3205
+ },
3206
+ },
3207
+ /**
3208
+ * Get trading parameters for an instrument
3209
+ * Example HTTP request:
3210
+ * GET /v1/assets/SBER@MISX/params?account_id=1440399
3211
+ * Authorization: <token>
3212
+ *
3213
+ * Parameters:
3214
+ * - symbol is passed in the URL path
3215
+ * - account_id is passed as a query parameter
3216
+ */
3217
+ getAssetParams: {
3218
+ name: "GetAssetParams",
3219
+ requestType: GetAssetParamsRequest,
3220
+ requestStream: false,
3221
+ responseType: GetAssetParamsResponse,
3222
+ responseStream: false,
3223
+ options: {
3224
+ _unknownFields: {
3225
+ 8338: [
3226
+ new Uint8Array([
3227
+ 120,
3228
+ 74,
3229
+ 97,
3230
+ 10,
3231
+ 3,
3232
+ 52,
3233
+ 48,
3234
+ 48,
3235
+ 18,
3236
+ 90,
3237
+ 10,
3238
+ 88,
3239
+ 73,
3240
+ 110,
3241
+ 118,
3242
+ 97,
3243
+ 108,
3244
+ 105,
3245
+ 100,
3246
+ 32,
3247
+ 115,
3248
+ 121,
3249
+ 109,
3250
+ 98,
3251
+ 111,
3252
+ 108,
3253
+ 32,
3254
+ 111,
3255
+ 114,
3256
+ 32,
3257
+ 97,
3258
+ 99,
3259
+ 99,
3260
+ 111,
3261
+ 117,
3262
+ 110,
3263
+ 116,
3264
+ 46,
3265
+ 32,
3266
+ 84,
3267
+ 104,
3268
+ 101,
3269
+ 32,
3270
+ 115,
3271
+ 121,
3272
+ 109,
3273
+ 98,
3274
+ 111,
3275
+ 108,
3276
+ 32,
3277
+ 109,
3278
+ 117,
3279
+ 115,
3280
+ 116,
3281
+ 32,
3282
+ 117,
3283
+ 115,
3284
+ 101,
3285
+ 32,
3286
+ 116,
3287
+ 105,
3288
+ 99,
3289
+ 107,
3290
+ 101,
3291
+ 114,
3292
+ 64,
3293
+ 109,
3294
+ 105,
3295
+ 99,
3296
+ 32,
3297
+ 102,
3298
+ 111,
3299
+ 114,
3300
+ 109,
3301
+ 97,
3302
+ 116,
3303
+ 44,
3304
+ 32,
3305
+ 102,
3306
+ 111,
3307
+ 114,
3308
+ 32,
3309
+ 101,
3310
+ 120,
3311
+ 97,
3312
+ 109,
3313
+ 112,
3314
+ 108,
3315
+ 101,
3316
+ 32,
3317
+ 83,
3318
+ 66,
3319
+ 69,
3320
+ 82,
3321
+ 64,
3322
+ 77,
3323
+ 73,
3324
+ 83,
3325
+ 88,
3326
+ 46,
3327
+ 98,
3328
+ 19,
3329
+ 10,
3330
+ 17,
3331
+ 10,
3332
+ 13,
3333
+ 65,
3334
+ 117,
3335
+ 116,
3336
+ 104,
3337
+ 111,
3338
+ 114,
3339
+ 105,
3340
+ 122,
3341
+ 97,
3342
+ 116,
3343
+ 105,
3344
+ 111,
3345
+ 110,
3346
+ 18,
3347
+ 0,
3348
+ ]),
3349
+ ],
3350
+ 578365826: [
3351
+ new Uint8Array([
3352
+ 28,
3353
+ 18,
3354
+ 26,
3355
+ 47,
3356
+ 118,
3357
+ 49,
3358
+ 47,
3359
+ 97,
3360
+ 115,
3361
+ 115,
3362
+ 101,
3363
+ 116,
3364
+ 115,
3365
+ 47,
3366
+ 123,
3367
+ 115,
3368
+ 121,
3369
+ 109,
3370
+ 98,
3371
+ 111,
3372
+ 108,
3373
+ 125,
3374
+ 47,
3375
+ 112,
3376
+ 97,
3377
+ 114,
3378
+ 97,
3379
+ 109,
3380
+ 115,
3381
+ ]),
3382
+ ],
3383
+ },
3384
+ },
3385
+ },
3386
+ /**
3387
+ * Retrieving an options chain for the underlying asset
3388
+ * Example HTTP request:
3389
+ * GET /v1/assets/SBER@MISX/options
3390
+ * Authorization: <token>
3391
+ */
3392
+ optionsChain: {
3393
+ name: "OptionsChain",
3394
+ requestType: OptionsChainRequest,
3395
+ requestStream: false,
3396
+ responseType: OptionsChainResponse,
3397
+ responseStream: false,
3398
+ options: {
3399
+ _unknownFields: {
3400
+ 8338: [
3401
+ new Uint8Array([
3402
+ 109,
3403
+ 74,
3404
+ 86,
3405
+ 10,
3406
+ 3,
3407
+ 52,
3408
+ 48,
3409
+ 48,
3410
+ 18,
3411
+ 79,
3412
+ 10,
3413
+ 77,
3414
+ 73,
3415
+ 110,
3416
+ 118,
3417
+ 97,
3418
+ 108,
3419
+ 105,
3420
+ 100,
3421
+ 32,
3422
+ 115,
3423
+ 121,
3424
+ 109,
3425
+ 98,
3426
+ 111,
3427
+ 108,
3428
+ 46,
3429
+ 32,
3430
+ 84,
3431
+ 104,
3432
+ 101,
3433
+ 32,
3434
+ 115,
3435
+ 121,
3436
+ 109,
3437
+ 98,
3438
+ 111,
3439
+ 108,
3440
+ 32,
3441
+ 109,
3442
+ 117,
3443
+ 115,
3444
+ 116,
3445
+ 32,
3446
+ 117,
3447
+ 115,
3448
+ 101,
3449
+ 32,
3450
+ 116,
3451
+ 105,
3452
+ 99,
3453
+ 107,
3454
+ 101,
3455
+ 114,
3456
+ 64,
3457
+ 109,
3458
+ 105,
3459
+ 99,
3460
+ 32,
3461
+ 102,
3462
+ 111,
3463
+ 114,
3464
+ 109,
3465
+ 97,
3466
+ 116,
3467
+ 44,
3468
+ 32,
3469
+ 102,
3470
+ 111,
3471
+ 114,
3472
+ 32,
3473
+ 101,
3474
+ 120,
3475
+ 97,
3476
+ 109,
3477
+ 112,
3478
+ 108,
3479
+ 101,
3480
+ 32,
3481
+ 83,
3482
+ 66,
3483
+ 69,
3484
+ 82,
3485
+ 64,
3486
+ 77,
3487
+ 73,
3488
+ 83,
3489
+ 88,
3490
+ 46,
3491
+ 98,
3492
+ 19,
3493
+ 10,
3494
+ 17,
3495
+ 10,
3496
+ 13,
3497
+ 65,
3498
+ 117,
3499
+ 116,
3500
+ 104,
3501
+ 111,
3502
+ 114,
3503
+ 105,
3504
+ 122,
3505
+ 97,
3506
+ 116,
3507
+ 105,
3508
+ 111,
3509
+ 110,
3510
+ 18,
3511
+ 0,
3512
+ ]),
3513
+ ],
3514
+ 578365826: [
3515
+ new Uint8Array([
3516
+ 40,
3517
+ 18,
3518
+ 38,
3519
+ 47,
3520
+ 118,
3521
+ 49,
3522
+ 47,
3523
+ 97,
3524
+ 115,
3525
+ 115,
3526
+ 101,
3527
+ 116,
3528
+ 115,
3529
+ 47,
3530
+ 123,
3531
+ 117,
3532
+ 110,
3533
+ 100,
3534
+ 101,
3535
+ 114,
3536
+ 108,
3537
+ 121,
3538
+ 105,
3539
+ 110,
3540
+ 103,
3541
+ 95,
3542
+ 115,
3543
+ 121,
3544
+ 109,
3545
+ 98,
3546
+ 111,
3547
+ 108,
3548
+ 125,
3549
+ 47,
3550
+ 111,
3551
+ 112,
3552
+ 116,
3553
+ 105,
3554
+ 111,
3555
+ 110,
3556
+ 115,
3557
+ ]),
3558
+ ],
3559
+ },
3560
+ },
3561
+ },
3562
+ /**
3563
+ * Get an instrument's trading schedule
3564
+ * Example HTTP request:
3565
+ * GET /v1/assets/SBER@MISX/schedule
3566
+ * Authorization: <token>
3567
+ */
3568
+ schedule: {
3569
+ name: "Schedule",
3570
+ requestType: ScheduleRequest,
3571
+ requestStream: false,
3572
+ responseType: ScheduleResponse,
3573
+ responseStream: false,
3574
+ options: {
3575
+ _unknownFields: {
3576
+ 8338: [
3577
+ new Uint8Array([
3578
+ 109,
3579
+ 74,
3580
+ 86,
3581
+ 10,
3582
+ 3,
3583
+ 52,
3584
+ 48,
3585
+ 48,
3586
+ 18,
3587
+ 79,
3588
+ 10,
3589
+ 77,
3590
+ 73,
3591
+ 110,
3592
+ 118,
3593
+ 97,
3594
+ 108,
3595
+ 105,
3596
+ 100,
3597
+ 32,
3598
+ 115,
3599
+ 121,
3600
+ 109,
3601
+ 98,
3602
+ 111,
3603
+ 108,
3604
+ 46,
3605
+ 32,
3606
+ 84,
3607
+ 104,
3608
+ 101,
3609
+ 32,
3610
+ 115,
3611
+ 121,
3612
+ 109,
3613
+ 98,
3614
+ 111,
3615
+ 108,
3616
+ 32,
3617
+ 109,
3618
+ 117,
3619
+ 115,
3620
+ 116,
3621
+ 32,
3622
+ 117,
3623
+ 115,
3624
+ 101,
3625
+ 32,
3626
+ 116,
3627
+ 105,
3628
+ 99,
3629
+ 107,
3630
+ 101,
3631
+ 114,
3632
+ 64,
3633
+ 109,
3634
+ 105,
3635
+ 99,
3636
+ 32,
3637
+ 102,
3638
+ 111,
3639
+ 114,
3640
+ 109,
3641
+ 97,
3642
+ 116,
3643
+ 44,
3644
+ 32,
3645
+ 102,
3646
+ 111,
3647
+ 114,
3648
+ 32,
3649
+ 101,
3650
+ 120,
3651
+ 97,
3652
+ 109,
3653
+ 112,
3654
+ 108,
3655
+ 101,
3656
+ 32,
3657
+ 83,
3658
+ 66,
3659
+ 69,
3660
+ 82,
3661
+ 64,
3662
+ 77,
3663
+ 73,
3664
+ 83,
3665
+ 88,
3666
+ 46,
3667
+ 98,
3668
+ 19,
3669
+ 10,
3670
+ 17,
3671
+ 10,
3672
+ 13,
3673
+ 65,
3674
+ 117,
3675
+ 116,
3676
+ 104,
3677
+ 111,
3678
+ 114,
3679
+ 105,
3680
+ 122,
3681
+ 97,
3682
+ 116,
3683
+ 105,
3684
+ 111,
3685
+ 110,
3686
+ 18,
3687
+ 0,
3688
+ ]),
3689
+ ],
3690
+ 578365826: [
3691
+ new Uint8Array([
3692
+ 30,
3693
+ 18,
3694
+ 28,
3695
+ 47,
3696
+ 118,
3697
+ 49,
3698
+ 47,
3699
+ 97,
3700
+ 115,
3701
+ 115,
3702
+ 101,
3703
+ 116,
3704
+ 115,
3705
+ 47,
3706
+ 123,
3707
+ 115,
3708
+ 121,
3709
+ 109,
3710
+ 98,
3711
+ 111,
3712
+ 108,
3713
+ 125,
3714
+ 47,
3715
+ 115,
3716
+ 99,
3717
+ 104,
3718
+ 101,
3719
+ 100,
3720
+ 117,
3721
+ 108,
3722
+ 101,
3723
+ ]),
3724
+ ],
3725
+ },
3726
+ },
3727
+ },
3728
+ /**
3729
+ * Get the server time
3730
+ * Example HTTP request:
3731
+ * GET /v1/assets/clock
3732
+ * Authorization: <token>
3733
+ */
3734
+ clock: {
3735
+ name: "Clock",
3736
+ requestType: ClockRequest,
3737
+ requestStream: false,
3738
+ responseType: ClockResponse,
3739
+ responseStream: false,
3740
+ options: {
3741
+ _unknownFields: {
3742
+ 8338: [
3743
+ new Uint8Array([
3744
+ 21,
3745
+ 98,
3746
+ 19,
3747
+ 10,
3748
+ 17,
3749
+ 10,
3750
+ 13,
3751
+ 65,
3752
+ 117,
3753
+ 116,
3754
+ 104,
3755
+ 111,
3756
+ 114,
3757
+ 105,
3758
+ 122,
3759
+ 97,
3760
+ 116,
3761
+ 105,
3762
+ 111,
3763
+ 110,
3764
+ 18,
3765
+ 0,
3766
+ ]),
3767
+ ],
3768
+ 578365826: [
3769
+ new Uint8Array([
3770
+ 18,
3771
+ 18,
3772
+ 16,
3773
+ 47,
3774
+ 118,
3775
+ 49,
3776
+ 47,
3777
+ 97,
3778
+ 115,
3779
+ 115,
3780
+ 101,
3781
+ 116,
3782
+ 115,
3783
+ 47,
3784
+ 99,
3785
+ 108,
3786
+ 111,
3787
+ 99,
3788
+ 107,
3789
+ ]),
3790
+ ],
3791
+ },
3792
+ },
3793
+ },
3794
+ /** Get the composition of a stock index by its symbol */
3795
+ getConstituents: {
3796
+ name: "GetConstituents",
3797
+ requestType: GetConstituentsRequest,
3798
+ requestStream: false,
3799
+ responseType: GetConstituentsResponse,
3800
+ responseStream: false,
3801
+ options: {
3802
+ _unknownFields: {
3803
+ 8338: [
3804
+ new Uint8Array([
3805
+ 21,
3806
+ 98,
3807
+ 19,
3808
+ 10,
3809
+ 17,
3810
+ 10,
3811
+ 13,
3812
+ 65,
3813
+ 117,
3814
+ 116,
3815
+ 104,
3816
+ 111,
3817
+ 114,
3818
+ 105,
3819
+ 122,
3820
+ 97,
3821
+ 116,
3822
+ 105,
3823
+ 111,
3824
+ 110,
3825
+ 18,
3826
+ 0,
3827
+ ]),
3828
+ ],
3829
+ 578365826: [
3830
+ new Uint8Array([
3831
+ 34,
3832
+ 18,
3833
+ 32,
3834
+ 47,
3835
+ 118,
3836
+ 49,
3837
+ 47,
3838
+ 97,
3839
+ 115,
3840
+ 115,
3841
+ 101,
3842
+ 116,
3843
+ 115,
3844
+ 47,
3845
+ 123,
3846
+ 115,
3847
+ 121,
3848
+ 109,
3849
+ 98,
3850
+ 111,
3851
+ 108,
3852
+ 125,
3853
+ 47,
3854
+ 99,
3855
+ 111,
3856
+ 110,
3857
+ 115,
3858
+ 116,
3859
+ 105,
3860
+ 116,
3861
+ 117,
3862
+ 101,
3863
+ 110,
3864
+ 116,
3865
+ 115,
3866
+ ]),
3867
+ ],
3868
+ },
3869
+ },
3870
+ },
3871
+ },
3872
+ };
3873
+ function toTimestamp(date) {
3874
+ const seconds = BigInt(Math.trunc(date.getTime() / 1_000));
3875
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
3876
+ return { seconds, nanos };
3877
+ }
3878
+ function fromTimestamp(t) {
3879
+ let millis = (globalThis.Number(t.seconds.toString()) || 0) * 1_000;
3880
+ millis += (t.nanos || 0) / 1_000_000;
3881
+ return new globalThis.Date(millis);
3882
+ }
3883
+ function fromJsonTimestamp(o) {
3884
+ if (o instanceof globalThis.Date) {
3885
+ return o;
3886
+ }
3887
+ else if (typeof o === "string") {
3888
+ return new globalThis.Date(o);
3889
+ }
3890
+ else {
3891
+ return fromTimestamp(Timestamp.fromJSON(o));
3892
+ }
3893
+ }
3894
+ function isSet(value) {
3895
+ return value !== null && value !== undefined;
3896
+ }
3897
+ //# sourceMappingURL=assets_service.js.map