@injectivelabs/indexer-proto-ts-v2 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/generated/event_provider_api_pb.client.d.ts +156 -0
  2. package/generated/event_provider_api_pb.client.js +76 -0
  3. package/generated/event_provider_api_pb.d.ts +1980 -0
  4. package/generated/event_provider_api_pb.js +1776 -0
  5. package/generated/health_pb.client.d.ts +53 -0
  6. package/generated/health_pb.client.js +22 -0
  7. package/generated/health_pb.d.ts +309 -0
  8. package/generated/health_pb.js +265 -0
  9. package/generated/injective_accounts_rpc_pb.client.d.ts +211 -0
  10. package/generated/injective_accounts_rpc_pb.client.js +105 -0
  11. package/generated/injective_accounts_rpc_pb.d.ts +5307 -0
  12. package/generated/injective_accounts_rpc_pb.js +4784 -0
  13. package/generated/injective_archiver_rpc_pb.client.d.ts +224 -0
  14. package/generated/injective_archiver_rpc_pb.client.js +112 -0
  15. package/generated/injective_archiver_rpc_pb.d.ts +2944 -0
  16. package/generated/injective_archiver_rpc_pb.js +2603 -0
  17. package/generated/injective_auction_rpc_pb.client.d.ts +190 -0
  18. package/generated/injective_auction_rpc_pb.client.js +94 -0
  19. package/generated/injective_auction_rpc_pb.d.ts +2131 -0
  20. package/generated/injective_auction_rpc_pb.js +1917 -0
  21. package/generated/injective_campaign_rpc_pb.client.d.ts +138 -0
  22. package/generated/injective_campaign_rpc_pb.client.js +67 -0
  23. package/generated/injective_campaign_rpc_pb.d.ts +2766 -0
  24. package/generated/injective_campaign_rpc_pb.js +2542 -0
  25. package/generated/injective_chart_rpc_pb.client.d.ts +159 -0
  26. package/generated/injective_chart_rpc_pb.client.js +78 -0
  27. package/generated/injective_chart_rpc_pb.d.ts +1840 -0
  28. package/generated/injective_chart_rpc_pb.js +1690 -0
  29. package/generated/injective_derivative_exchange_rpc_pb.client.d.ts +504 -0
  30. package/generated/injective_derivative_exchange_rpc_pb.client.js +259 -0
  31. package/generated/injective_derivative_exchange_rpc_pb.d.ts +9214 -0
  32. package/generated/injective_derivative_exchange_rpc_pb.js +8407 -0
  33. package/generated/injective_exchange_rpc_pb.client.d.ts +155 -0
  34. package/generated/injective_exchange_rpc_pb.client.js +76 -0
  35. package/generated/injective_exchange_rpc_pb.d.ts +1925 -0
  36. package/generated/injective_exchange_rpc_pb.js +1740 -0
  37. package/generated/injective_explorer_rpc_pb.client.d.ts +495 -0
  38. package/generated/injective_explorer_rpc_pb.client.js +255 -0
  39. package/generated/injective_explorer_rpc_pb.d.ts +9394 -0
  40. package/generated/injective_explorer_rpc_pb.js +8921 -0
  41. package/generated/injective_insurance_rpc_pb.client.d.ts +87 -0
  42. package/generated/injective_insurance_rpc_pb.client.js +40 -0
  43. package/generated/injective_insurance_rpc_pb.d.ts +904 -0
  44. package/generated/injective_insurance_rpc_pb.js +807 -0
  45. package/generated/injective_megavault_rpc_pb.client.d.ts +155 -0
  46. package/generated/injective_megavault_rpc_pb.client.js +76 -0
  47. package/generated/injective_megavault_rpc_pb.d.ts +3408 -0
  48. package/generated/injective_megavault_rpc_pb.js +3019 -0
  49. package/generated/injective_meta_rpc_pb.client.d.ts +124 -0
  50. package/generated/injective_meta_rpc_pb.client.js +59 -0
  51. package/generated/injective_meta_rpc_pb.d.ts +825 -0
  52. package/generated/injective_meta_rpc_pb.js +716 -0
  53. package/generated/injective_oracle_rpc_pb.client.d.ts +124 -0
  54. package/generated/injective_oracle_rpc_pb.client.js +59 -0
  55. package/generated/injective_oracle_rpc_pb.d.ts +1117 -0
  56. package/generated/injective_oracle_rpc_pb.js +987 -0
  57. package/generated/injective_portfolio_rpc_pb.client.d.ts +105 -0
  58. package/generated/injective_portfolio_rpc_pb.client.js +49 -0
  59. package/generated/injective_portfolio_rpc_pb.d.ts +1492 -0
  60. package/generated/injective_portfolio_rpc_pb.js +1314 -0
  61. package/generated/injective_referral_rpc_pb.client.d.ts +89 -0
  62. package/generated/injective_referral_rpc_pb.client.js +41 -0
  63. package/generated/injective_referral_rpc_pb.d.ts +575 -0
  64. package/generated/injective_referral_rpc_pb.js +497 -0
  65. package/generated/injective_rfqrpc_pb.client.d.ts +208 -0
  66. package/generated/injective_rfqrpc_pb.client.js +103 -0
  67. package/generated/injective_rfqrpc_pb.d.ts +2241 -0
  68. package/generated/injective_rfqrpc_pb.js +1940 -0
  69. package/generated/injective_spot_exchange_rpc_pb.client.d.ts +343 -0
  70. package/generated/injective_spot_exchange_rpc_pb.client.js +175 -0
  71. package/generated/injective_spot_exchange_rpc_pb.d.ts +5958 -0
  72. package/generated/injective_spot_exchange_rpc_pb.js +5426 -0
  73. package/generated/injective_trading_rpc_pb.client.d.ts +90 -0
  74. package/generated/injective_trading_rpc_pb.client.js +40 -0
  75. package/generated/injective_trading_rpc_pb.d.ts +1882 -0
  76. package/generated/injective_trading_rpc_pb.js +1754 -0
  77. package/index.d.ts +43 -0
  78. package/index.js +78 -0
  79. package/package.json +37 -0
@@ -0,0 +1,1492 @@
1
+ // @generated by protobuf-ts 2.11.1 with parameter add_pb_suffix
2
+ // @generated from protobuf file "injective_portfolio_rpc.proto" (package "injective_portfolio_rpc", syntax proto3)
3
+ // tslint:disable
4
+ //
5
+ // Code generated with goa v3.7.0, DO NOT EDIT.
6
+ //
7
+ // InjectivePortfolioRPC protocol buffer definition
8
+ //
9
+ // Command:
10
+ // $ goa gen github.com/InjectiveLabs/injective-indexer/api/design -o ../
11
+ //
12
+ import { ServiceType } from "@protobuf-ts/runtime-rpc";
13
+ import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
14
+ import type { IBinaryWriter } from "@protobuf-ts/runtime";
15
+ import { WireType } from "@protobuf-ts/runtime";
16
+ import type { BinaryReadOptions } from "@protobuf-ts/runtime";
17
+ import type { IBinaryReader } from "@protobuf-ts/runtime";
18
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
19
+ import type { PartialMessage } from "@protobuf-ts/runtime";
20
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
21
+ import { MessageType } from "@protobuf-ts/runtime";
22
+ /**
23
+ * @generated from protobuf message injective_portfolio_rpc.TokenHoldersRequest
24
+ */
25
+ export interface TokenHoldersRequest {
26
+ /**
27
+ * Denom of the token
28
+ *
29
+ * @generated from protobuf field: string denom = 1
30
+ */
31
+ denom: string;
32
+ /**
33
+ * Cursor for pagination
34
+ *
35
+ * @generated from protobuf field: string cursor = 2
36
+ */
37
+ cursor: string;
38
+ /**
39
+ * @generated from protobuf field: sint32 limit = 3
40
+ */
41
+ limit: number;
42
+ }
43
+ /**
44
+ * @generated from protobuf message injective_portfolio_rpc.TokenHoldersResponse
45
+ */
46
+ export interface TokenHoldersResponse {
47
+ /**
48
+ * @generated from protobuf field: repeated injective_portfolio_rpc.Holder holders = 1
49
+ */
50
+ holders: Holder[];
51
+ /**
52
+ * Next cursors for pagination
53
+ *
54
+ * @generated from protobuf field: repeated string next_cursors = 2
55
+ */
56
+ nextCursors: string[];
57
+ }
58
+ /**
59
+ * @generated from protobuf message injective_portfolio_rpc.Holder
60
+ */
61
+ export interface Holder {
62
+ /**
63
+ * Account address for the holder
64
+ *
65
+ * @generated from protobuf field: string account_address = 1
66
+ */
67
+ accountAddress: string;
68
+ /**
69
+ * The balance of the holder
70
+ *
71
+ * @generated from protobuf field: string balance = 2
72
+ */
73
+ balance: string;
74
+ }
75
+ /**
76
+ * @generated from protobuf message injective_portfolio_rpc.AccountPortfolioRequest
77
+ */
78
+ export interface AccountPortfolioRequest {
79
+ /**
80
+ * Account address
81
+ *
82
+ * @generated from protobuf field: string account_address = 1
83
+ */
84
+ accountAddress: string;
85
+ }
86
+ /**
87
+ * @generated from protobuf message injective_portfolio_rpc.AccountPortfolioResponse
88
+ */
89
+ export interface AccountPortfolioResponse {
90
+ /**
91
+ * The portfolio of this account
92
+ *
93
+ * @generated from protobuf field: injective_portfolio_rpc.Portfolio portfolio = 1
94
+ */
95
+ portfolio?: Portfolio;
96
+ }
97
+ /**
98
+ * @generated from protobuf message injective_portfolio_rpc.Portfolio
99
+ */
100
+ export interface Portfolio {
101
+ /**
102
+ * The account's portfolio address
103
+ *
104
+ * @generated from protobuf field: string account_address = 1
105
+ */
106
+ accountAddress: string;
107
+ /**
108
+ * Account available bank balances
109
+ *
110
+ * @generated from protobuf field: repeated injective_portfolio_rpc.Coin bank_balances = 2
111
+ */
112
+ bankBalances: Coin[];
113
+ /**
114
+ * Subaccounts list
115
+ *
116
+ * @generated from protobuf field: repeated injective_portfolio_rpc.SubaccountBalanceV2 subaccounts = 3
117
+ */
118
+ subaccounts: SubaccountBalanceV2[];
119
+ /**
120
+ * All positions for all subaccounts, with unrealized PNL
121
+ *
122
+ * @generated from protobuf field: repeated injective_portfolio_rpc.PositionsWithUPNL positions_with_upnl = 4
123
+ */
124
+ positionsWithUpnl: PositionsWithUPNL[];
125
+ }
126
+ /**
127
+ * @generated from protobuf message injective_portfolio_rpc.Coin
128
+ */
129
+ export interface Coin {
130
+ /**
131
+ * Denom of the coin
132
+ *
133
+ * @generated from protobuf field: string denom = 1
134
+ */
135
+ denom: string;
136
+ /**
137
+ * @generated from protobuf field: string amount = 2
138
+ */
139
+ amount: string;
140
+ /**
141
+ * @generated from protobuf field: string usd_value = 3
142
+ */
143
+ usdValue: string;
144
+ }
145
+ /**
146
+ * @generated from protobuf message injective_portfolio_rpc.SubaccountBalanceV2
147
+ */
148
+ export interface SubaccountBalanceV2 {
149
+ /**
150
+ * Related subaccount ID
151
+ *
152
+ * @generated from protobuf field: string subaccount_id = 1
153
+ */
154
+ subaccountId: string;
155
+ /**
156
+ * Coin denom on the chain.
157
+ *
158
+ * @generated from protobuf field: string denom = 2
159
+ */
160
+ denom: string;
161
+ /**
162
+ * @generated from protobuf field: injective_portfolio_rpc.SubaccountDeposit deposit = 3
163
+ */
164
+ deposit?: SubaccountDeposit;
165
+ }
166
+ /**
167
+ * @generated from protobuf message injective_portfolio_rpc.SubaccountDeposit
168
+ */
169
+ export interface SubaccountDeposit {
170
+ /**
171
+ * @generated from protobuf field: string total_balance = 1
172
+ */
173
+ totalBalance: string;
174
+ /**
175
+ * @generated from protobuf field: string available_balance = 2
176
+ */
177
+ availableBalance: string;
178
+ /**
179
+ * @generated from protobuf field: string total_balance_usd = 3
180
+ */
181
+ totalBalanceUsd: string;
182
+ /**
183
+ * @generated from protobuf field: string available_balance_usd = 4
184
+ */
185
+ availableBalanceUsd: string;
186
+ }
187
+ /**
188
+ * @generated from protobuf message injective_portfolio_rpc.PositionsWithUPNL
189
+ */
190
+ export interface PositionsWithUPNL {
191
+ /**
192
+ * @generated from protobuf field: injective_portfolio_rpc.DerivativePosition position = 1
193
+ */
194
+ position?: DerivativePosition;
195
+ /**
196
+ * Unrealized PNL
197
+ *
198
+ * @generated from protobuf field: string unrealized_pnl = 2
199
+ */
200
+ unrealizedPnl: string;
201
+ }
202
+ /**
203
+ * @generated from protobuf message injective_portfolio_rpc.DerivativePosition
204
+ */
205
+ export interface DerivativePosition {
206
+ /**
207
+ * Ticker of the derivative market
208
+ *
209
+ * @generated from protobuf field: string ticker = 1
210
+ */
211
+ ticker: string;
212
+ /**
213
+ * Derivative Market ID
214
+ *
215
+ * @generated from protobuf field: string market_id = 2
216
+ */
217
+ marketId: string;
218
+ /**
219
+ * The subaccountId that the position belongs to
220
+ *
221
+ * @generated from protobuf field: string subaccount_id = 3
222
+ */
223
+ subaccountId: string;
224
+ /**
225
+ * Direction of the position
226
+ *
227
+ * @generated from protobuf field: string direction = 4
228
+ */
229
+ direction: string;
230
+ /**
231
+ * Quantity of the position
232
+ *
233
+ * @generated from protobuf field: string quantity = 5
234
+ */
235
+ quantity: string;
236
+ /**
237
+ * Price of the position
238
+ *
239
+ * @generated from protobuf field: string entry_price = 6
240
+ */
241
+ entryPrice: string;
242
+ /**
243
+ * Margin of the position
244
+ *
245
+ * @generated from protobuf field: string margin = 7
246
+ */
247
+ margin: string;
248
+ /**
249
+ * LiquidationPrice of the position
250
+ *
251
+ * @generated from protobuf field: string liquidation_price = 8
252
+ */
253
+ liquidationPrice: string;
254
+ /**
255
+ * MarkPrice of the position
256
+ *
257
+ * @generated from protobuf field: string mark_price = 9
258
+ */
259
+ markPrice: string;
260
+ /**
261
+ * Aggregate Quantity of the Reduce Only orders associated with the position
262
+ *
263
+ * @generated from protobuf field: string aggregate_reduce_only_quantity = 11
264
+ */
265
+ aggregateReduceOnlyQuantity: string;
266
+ /**
267
+ * Position updated timestamp in UNIX millis.
268
+ *
269
+ * @generated from protobuf field: sint64 updated_at = 12
270
+ */
271
+ updatedAt: bigint;
272
+ /**
273
+ * Position created timestamp in UNIX millis.
274
+ *
275
+ * @generated from protobuf field: sint64 created_at = 13
276
+ */
277
+ createdAt: bigint;
278
+ /**
279
+ * Last funding fees since position opened
280
+ *
281
+ * @generated from protobuf field: string funding_last = 14
282
+ */
283
+ fundingLast: string;
284
+ /**
285
+ * Net funding fees since position opened
286
+ *
287
+ * @generated from protobuf field: string funding_sum = 15
288
+ */
289
+ fundingSum: string;
290
+ /**
291
+ * Cumulative funding entry of the position
292
+ *
293
+ * @generated from protobuf field: string cumulative_funding_entry = 16
294
+ */
295
+ cumulativeFundingEntry: string;
296
+ /**
297
+ * Effective cumulative funding entry of the position
298
+ *
299
+ * @generated from protobuf field: string effective_cumulative_funding_entry = 17
300
+ */
301
+ effectiveCumulativeFundingEntry: string;
302
+ }
303
+ /**
304
+ * @generated from protobuf message injective_portfolio_rpc.AccountPortfolioBalancesRequest
305
+ */
306
+ export interface AccountPortfolioBalancesRequest {
307
+ /**
308
+ * Account address
309
+ *
310
+ * @generated from protobuf field: string account_address = 1
311
+ */
312
+ accountAddress: string;
313
+ /**
314
+ * Whether to return USD values for the balances
315
+ *
316
+ * @generated from protobuf field: bool usd = 2
317
+ */
318
+ usd: boolean;
319
+ }
320
+ /**
321
+ * @generated from protobuf message injective_portfolio_rpc.AccountPortfolioBalancesResponse
322
+ */
323
+ export interface AccountPortfolioBalancesResponse {
324
+ /**
325
+ * The portfolio balances of this account
326
+ *
327
+ * @generated from protobuf field: injective_portfolio_rpc.PortfolioBalances portfolio = 1
328
+ */
329
+ portfolio?: PortfolioBalances;
330
+ }
331
+ /**
332
+ * @generated from protobuf message injective_portfolio_rpc.PortfolioBalances
333
+ */
334
+ export interface PortfolioBalances {
335
+ /**
336
+ * The account's portfolio address
337
+ *
338
+ * @generated from protobuf field: string account_address = 1
339
+ */
340
+ accountAddress: string;
341
+ /**
342
+ * Account available bank balances
343
+ *
344
+ * @generated from protobuf field: repeated injective_portfolio_rpc.Coin bank_balances = 2
345
+ */
346
+ bankBalances: Coin[];
347
+ /**
348
+ * Subaccounts list
349
+ *
350
+ * @generated from protobuf field: repeated injective_portfolio_rpc.SubaccountBalanceV2 subaccounts = 3
351
+ */
352
+ subaccounts: SubaccountBalanceV2[];
353
+ /**
354
+ * USD value of the portfolio
355
+ *
356
+ * @generated from protobuf field: string total_usd = 4
357
+ */
358
+ totalUsd: string;
359
+ }
360
+ /**
361
+ * @generated from protobuf message injective_portfolio_rpc.StreamAccountPortfolioRequest
362
+ */
363
+ export interface StreamAccountPortfolioRequest {
364
+ /**
365
+ * The account's portfolio address
366
+ *
367
+ * @generated from protobuf field: string account_address = 1
368
+ */
369
+ accountAddress: string;
370
+ /**
371
+ * Related subaccount ID
372
+ *
373
+ * @generated from protobuf field: string subaccount_id = 2
374
+ */
375
+ subaccountId: string;
376
+ /**
377
+ * @generated from protobuf field: string type = 3
378
+ */
379
+ type: string;
380
+ }
381
+ /**
382
+ * @generated from protobuf message injective_portfolio_rpc.StreamAccountPortfolioResponse
383
+ */
384
+ export interface StreamAccountPortfolioResponse {
385
+ /**
386
+ * type of portfolio entry
387
+ *
388
+ * @generated from protobuf field: string type = 1
389
+ */
390
+ type: string;
391
+ /**
392
+ * denom of portfolio entry
393
+ *
394
+ * @generated from protobuf field: string denom = 2
395
+ */
396
+ denom: string;
397
+ /**
398
+ * amount of portfolio entry
399
+ *
400
+ * @generated from protobuf field: string amount = 3
401
+ */
402
+ amount: string;
403
+ /**
404
+ * subaccount id of portfolio entry
405
+ *
406
+ * @generated from protobuf field: string subaccount_id = 4
407
+ */
408
+ subaccountId: string;
409
+ /**
410
+ * Operation timestamp in UNIX millis.
411
+ *
412
+ * @generated from protobuf field: sint64 timestamp = 5
413
+ */
414
+ timestamp: bigint;
415
+ }
416
+ // @generated message type with reflection information, may provide speed optimized methods
417
+ class TokenHoldersRequest$Type extends MessageType<TokenHoldersRequest> {
418
+ constructor() {
419
+ super("injective_portfolio_rpc.TokenHoldersRequest", [
420
+ { no: 1, name: "denom", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
421
+ { no: 2, name: "cursor", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
422
+ { no: 3, name: "limit", kind: "scalar", T: 17 /*ScalarType.SINT32*/ }
423
+ ]);
424
+ }
425
+ create(value?: PartialMessage<TokenHoldersRequest>): TokenHoldersRequest {
426
+ const message = globalThis.Object.create((this.messagePrototype!));
427
+ message.denom = "";
428
+ message.cursor = "";
429
+ message.limit = 0;
430
+ if (value !== undefined)
431
+ reflectionMergePartial<TokenHoldersRequest>(this, message, value);
432
+ return message;
433
+ }
434
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TokenHoldersRequest): TokenHoldersRequest {
435
+ let message = target ?? this.create(), end = reader.pos + length;
436
+ while (reader.pos < end) {
437
+ let [fieldNo, wireType] = reader.tag();
438
+ switch (fieldNo) {
439
+ case /* string denom */ 1:
440
+ message.denom = reader.string();
441
+ break;
442
+ case /* string cursor */ 2:
443
+ message.cursor = reader.string();
444
+ break;
445
+ case /* sint32 limit */ 3:
446
+ message.limit = reader.sint32();
447
+ break;
448
+ default:
449
+ let u = options.readUnknownField;
450
+ if (u === "throw")
451
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
452
+ let d = reader.skip(wireType);
453
+ if (u !== false)
454
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
455
+ }
456
+ }
457
+ return message;
458
+ }
459
+ internalBinaryWrite(message: TokenHoldersRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
460
+ /* string denom = 1; */
461
+ if (message.denom !== "")
462
+ writer.tag(1, WireType.LengthDelimited).string(message.denom);
463
+ /* string cursor = 2; */
464
+ if (message.cursor !== "")
465
+ writer.tag(2, WireType.LengthDelimited).string(message.cursor);
466
+ /* sint32 limit = 3; */
467
+ if (message.limit !== 0)
468
+ writer.tag(3, WireType.Varint).sint32(message.limit);
469
+ let u = options.writeUnknownFields;
470
+ if (u !== false)
471
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
472
+ return writer;
473
+ }
474
+ }
475
+ /**
476
+ * @generated MessageType for protobuf message injective_portfolio_rpc.TokenHoldersRequest
477
+ */
478
+ export const TokenHoldersRequest = new TokenHoldersRequest$Type();
479
+ // @generated message type with reflection information, may provide speed optimized methods
480
+ class TokenHoldersResponse$Type extends MessageType<TokenHoldersResponse> {
481
+ constructor() {
482
+ super("injective_portfolio_rpc.TokenHoldersResponse", [
483
+ { no: 1, name: "holders", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Holder },
484
+ { no: 2, name: "next_cursors", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
485
+ ]);
486
+ }
487
+ create(value?: PartialMessage<TokenHoldersResponse>): TokenHoldersResponse {
488
+ const message = globalThis.Object.create((this.messagePrototype!));
489
+ message.holders = [];
490
+ message.nextCursors = [];
491
+ if (value !== undefined)
492
+ reflectionMergePartial<TokenHoldersResponse>(this, message, value);
493
+ return message;
494
+ }
495
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TokenHoldersResponse): TokenHoldersResponse {
496
+ let message = target ?? this.create(), end = reader.pos + length;
497
+ while (reader.pos < end) {
498
+ let [fieldNo, wireType] = reader.tag();
499
+ switch (fieldNo) {
500
+ case /* repeated injective_portfolio_rpc.Holder holders */ 1:
501
+ message.holders.push(Holder.internalBinaryRead(reader, reader.uint32(), options));
502
+ break;
503
+ case /* repeated string next_cursors */ 2:
504
+ message.nextCursors.push(reader.string());
505
+ break;
506
+ default:
507
+ let u = options.readUnknownField;
508
+ if (u === "throw")
509
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
510
+ let d = reader.skip(wireType);
511
+ if (u !== false)
512
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
513
+ }
514
+ }
515
+ return message;
516
+ }
517
+ internalBinaryWrite(message: TokenHoldersResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
518
+ /* repeated injective_portfolio_rpc.Holder holders = 1; */
519
+ for (let i = 0; i < message.holders.length; i++)
520
+ Holder.internalBinaryWrite(message.holders[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
521
+ /* repeated string next_cursors = 2; */
522
+ for (let i = 0; i < message.nextCursors.length; i++)
523
+ writer.tag(2, WireType.LengthDelimited).string(message.nextCursors[i]);
524
+ let u = options.writeUnknownFields;
525
+ if (u !== false)
526
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
527
+ return writer;
528
+ }
529
+ }
530
+ /**
531
+ * @generated MessageType for protobuf message injective_portfolio_rpc.TokenHoldersResponse
532
+ */
533
+ export const TokenHoldersResponse = new TokenHoldersResponse$Type();
534
+ // @generated message type with reflection information, may provide speed optimized methods
535
+ class Holder$Type extends MessageType<Holder> {
536
+ constructor() {
537
+ super("injective_portfolio_rpc.Holder", [
538
+ { no: 1, name: "account_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
539
+ { no: 2, name: "balance", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
540
+ ]);
541
+ }
542
+ create(value?: PartialMessage<Holder>): Holder {
543
+ const message = globalThis.Object.create((this.messagePrototype!));
544
+ message.accountAddress = "";
545
+ message.balance = "";
546
+ if (value !== undefined)
547
+ reflectionMergePartial<Holder>(this, message, value);
548
+ return message;
549
+ }
550
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Holder): Holder {
551
+ let message = target ?? this.create(), end = reader.pos + length;
552
+ while (reader.pos < end) {
553
+ let [fieldNo, wireType] = reader.tag();
554
+ switch (fieldNo) {
555
+ case /* string account_address */ 1:
556
+ message.accountAddress = reader.string();
557
+ break;
558
+ case /* string balance */ 2:
559
+ message.balance = reader.string();
560
+ break;
561
+ default:
562
+ let u = options.readUnknownField;
563
+ if (u === "throw")
564
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
565
+ let d = reader.skip(wireType);
566
+ if (u !== false)
567
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
568
+ }
569
+ }
570
+ return message;
571
+ }
572
+ internalBinaryWrite(message: Holder, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
573
+ /* string account_address = 1; */
574
+ if (message.accountAddress !== "")
575
+ writer.tag(1, WireType.LengthDelimited).string(message.accountAddress);
576
+ /* string balance = 2; */
577
+ if (message.balance !== "")
578
+ writer.tag(2, WireType.LengthDelimited).string(message.balance);
579
+ let u = options.writeUnknownFields;
580
+ if (u !== false)
581
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
582
+ return writer;
583
+ }
584
+ }
585
+ /**
586
+ * @generated MessageType for protobuf message injective_portfolio_rpc.Holder
587
+ */
588
+ export const Holder = new Holder$Type();
589
+ // @generated message type with reflection information, may provide speed optimized methods
590
+ class AccountPortfolioRequest$Type extends MessageType<AccountPortfolioRequest> {
591
+ constructor() {
592
+ super("injective_portfolio_rpc.AccountPortfolioRequest", [
593
+ { no: 1, name: "account_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
594
+ ]);
595
+ }
596
+ create(value?: PartialMessage<AccountPortfolioRequest>): AccountPortfolioRequest {
597
+ const message = globalThis.Object.create((this.messagePrototype!));
598
+ message.accountAddress = "";
599
+ if (value !== undefined)
600
+ reflectionMergePartial<AccountPortfolioRequest>(this, message, value);
601
+ return message;
602
+ }
603
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AccountPortfolioRequest): AccountPortfolioRequest {
604
+ let message = target ?? this.create(), end = reader.pos + length;
605
+ while (reader.pos < end) {
606
+ let [fieldNo, wireType] = reader.tag();
607
+ switch (fieldNo) {
608
+ case /* string account_address */ 1:
609
+ message.accountAddress = reader.string();
610
+ break;
611
+ default:
612
+ let u = options.readUnknownField;
613
+ if (u === "throw")
614
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
615
+ let d = reader.skip(wireType);
616
+ if (u !== false)
617
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
618
+ }
619
+ }
620
+ return message;
621
+ }
622
+ internalBinaryWrite(message: AccountPortfolioRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
623
+ /* string account_address = 1; */
624
+ if (message.accountAddress !== "")
625
+ writer.tag(1, WireType.LengthDelimited).string(message.accountAddress);
626
+ let u = options.writeUnknownFields;
627
+ if (u !== false)
628
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
629
+ return writer;
630
+ }
631
+ }
632
+ /**
633
+ * @generated MessageType for protobuf message injective_portfolio_rpc.AccountPortfolioRequest
634
+ */
635
+ export const AccountPortfolioRequest = new AccountPortfolioRequest$Type();
636
+ // @generated message type with reflection information, may provide speed optimized methods
637
+ class AccountPortfolioResponse$Type extends MessageType<AccountPortfolioResponse> {
638
+ constructor() {
639
+ super("injective_portfolio_rpc.AccountPortfolioResponse", [
640
+ { no: 1, name: "portfolio", kind: "message", T: () => Portfolio }
641
+ ]);
642
+ }
643
+ create(value?: PartialMessage<AccountPortfolioResponse>): AccountPortfolioResponse {
644
+ const message = globalThis.Object.create((this.messagePrototype!));
645
+ if (value !== undefined)
646
+ reflectionMergePartial<AccountPortfolioResponse>(this, message, value);
647
+ return message;
648
+ }
649
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AccountPortfolioResponse): AccountPortfolioResponse {
650
+ let message = target ?? this.create(), end = reader.pos + length;
651
+ while (reader.pos < end) {
652
+ let [fieldNo, wireType] = reader.tag();
653
+ switch (fieldNo) {
654
+ case /* injective_portfolio_rpc.Portfolio portfolio */ 1:
655
+ message.portfolio = Portfolio.internalBinaryRead(reader, reader.uint32(), options, message.portfolio);
656
+ break;
657
+ default:
658
+ let u = options.readUnknownField;
659
+ if (u === "throw")
660
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
661
+ let d = reader.skip(wireType);
662
+ if (u !== false)
663
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
664
+ }
665
+ }
666
+ return message;
667
+ }
668
+ internalBinaryWrite(message: AccountPortfolioResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
669
+ /* injective_portfolio_rpc.Portfolio portfolio = 1; */
670
+ if (message.portfolio)
671
+ Portfolio.internalBinaryWrite(message.portfolio, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
672
+ let u = options.writeUnknownFields;
673
+ if (u !== false)
674
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
675
+ return writer;
676
+ }
677
+ }
678
+ /**
679
+ * @generated MessageType for protobuf message injective_portfolio_rpc.AccountPortfolioResponse
680
+ */
681
+ export const AccountPortfolioResponse = new AccountPortfolioResponse$Type();
682
+ // @generated message type with reflection information, may provide speed optimized methods
683
+ class Portfolio$Type extends MessageType<Portfolio> {
684
+ constructor() {
685
+ super("injective_portfolio_rpc.Portfolio", [
686
+ { no: 1, name: "account_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
687
+ { no: 2, name: "bank_balances", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Coin },
688
+ { no: 3, name: "subaccounts", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => SubaccountBalanceV2 },
689
+ { no: 4, name: "positions_with_upnl", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => PositionsWithUPNL }
690
+ ]);
691
+ }
692
+ create(value?: PartialMessage<Portfolio>): Portfolio {
693
+ const message = globalThis.Object.create((this.messagePrototype!));
694
+ message.accountAddress = "";
695
+ message.bankBalances = [];
696
+ message.subaccounts = [];
697
+ message.positionsWithUpnl = [];
698
+ if (value !== undefined)
699
+ reflectionMergePartial<Portfolio>(this, message, value);
700
+ return message;
701
+ }
702
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Portfolio): Portfolio {
703
+ let message = target ?? this.create(), end = reader.pos + length;
704
+ while (reader.pos < end) {
705
+ let [fieldNo, wireType] = reader.tag();
706
+ switch (fieldNo) {
707
+ case /* string account_address */ 1:
708
+ message.accountAddress = reader.string();
709
+ break;
710
+ case /* repeated injective_portfolio_rpc.Coin bank_balances */ 2:
711
+ message.bankBalances.push(Coin.internalBinaryRead(reader, reader.uint32(), options));
712
+ break;
713
+ case /* repeated injective_portfolio_rpc.SubaccountBalanceV2 subaccounts */ 3:
714
+ message.subaccounts.push(SubaccountBalanceV2.internalBinaryRead(reader, reader.uint32(), options));
715
+ break;
716
+ case /* repeated injective_portfolio_rpc.PositionsWithUPNL positions_with_upnl */ 4:
717
+ message.positionsWithUpnl.push(PositionsWithUPNL.internalBinaryRead(reader, reader.uint32(), options));
718
+ break;
719
+ default:
720
+ let u = options.readUnknownField;
721
+ if (u === "throw")
722
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
723
+ let d = reader.skip(wireType);
724
+ if (u !== false)
725
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
726
+ }
727
+ }
728
+ return message;
729
+ }
730
+ internalBinaryWrite(message: Portfolio, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
731
+ /* string account_address = 1; */
732
+ if (message.accountAddress !== "")
733
+ writer.tag(1, WireType.LengthDelimited).string(message.accountAddress);
734
+ /* repeated injective_portfolio_rpc.Coin bank_balances = 2; */
735
+ for (let i = 0; i < message.bankBalances.length; i++)
736
+ Coin.internalBinaryWrite(message.bankBalances[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
737
+ /* repeated injective_portfolio_rpc.SubaccountBalanceV2 subaccounts = 3; */
738
+ for (let i = 0; i < message.subaccounts.length; i++)
739
+ SubaccountBalanceV2.internalBinaryWrite(message.subaccounts[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
740
+ /* repeated injective_portfolio_rpc.PositionsWithUPNL positions_with_upnl = 4; */
741
+ for (let i = 0; i < message.positionsWithUpnl.length; i++)
742
+ PositionsWithUPNL.internalBinaryWrite(message.positionsWithUpnl[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join();
743
+ let u = options.writeUnknownFields;
744
+ if (u !== false)
745
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
746
+ return writer;
747
+ }
748
+ }
749
+ /**
750
+ * @generated MessageType for protobuf message injective_portfolio_rpc.Portfolio
751
+ */
752
+ export const Portfolio = new Portfolio$Type();
753
+ // @generated message type with reflection information, may provide speed optimized methods
754
+ class Coin$Type extends MessageType<Coin> {
755
+ constructor() {
756
+ super("injective_portfolio_rpc.Coin", [
757
+ { no: 1, name: "denom", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
758
+ { no: 2, name: "amount", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
759
+ { no: 3, name: "usd_value", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
760
+ ]);
761
+ }
762
+ create(value?: PartialMessage<Coin>): Coin {
763
+ const message = globalThis.Object.create((this.messagePrototype!));
764
+ message.denom = "";
765
+ message.amount = "";
766
+ message.usdValue = "";
767
+ if (value !== undefined)
768
+ reflectionMergePartial<Coin>(this, message, value);
769
+ return message;
770
+ }
771
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Coin): Coin {
772
+ let message = target ?? this.create(), end = reader.pos + length;
773
+ while (reader.pos < end) {
774
+ let [fieldNo, wireType] = reader.tag();
775
+ switch (fieldNo) {
776
+ case /* string denom */ 1:
777
+ message.denom = reader.string();
778
+ break;
779
+ case /* string amount */ 2:
780
+ message.amount = reader.string();
781
+ break;
782
+ case /* string usd_value */ 3:
783
+ message.usdValue = reader.string();
784
+ break;
785
+ default:
786
+ let u = options.readUnknownField;
787
+ if (u === "throw")
788
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
789
+ let d = reader.skip(wireType);
790
+ if (u !== false)
791
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
792
+ }
793
+ }
794
+ return message;
795
+ }
796
+ internalBinaryWrite(message: Coin, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
797
+ /* string denom = 1; */
798
+ if (message.denom !== "")
799
+ writer.tag(1, WireType.LengthDelimited).string(message.denom);
800
+ /* string amount = 2; */
801
+ if (message.amount !== "")
802
+ writer.tag(2, WireType.LengthDelimited).string(message.amount);
803
+ /* string usd_value = 3; */
804
+ if (message.usdValue !== "")
805
+ writer.tag(3, WireType.LengthDelimited).string(message.usdValue);
806
+ let u = options.writeUnknownFields;
807
+ if (u !== false)
808
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
809
+ return writer;
810
+ }
811
+ }
812
+ /**
813
+ * @generated MessageType for protobuf message injective_portfolio_rpc.Coin
814
+ */
815
+ export const Coin = new Coin$Type();
816
+ // @generated message type with reflection information, may provide speed optimized methods
817
+ class SubaccountBalanceV2$Type extends MessageType<SubaccountBalanceV2> {
818
+ constructor() {
819
+ super("injective_portfolio_rpc.SubaccountBalanceV2", [
820
+ { no: 1, name: "subaccount_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
821
+ { no: 2, name: "denom", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
822
+ { no: 3, name: "deposit", kind: "message", T: () => SubaccountDeposit }
823
+ ]);
824
+ }
825
+ create(value?: PartialMessage<SubaccountBalanceV2>): SubaccountBalanceV2 {
826
+ const message = globalThis.Object.create((this.messagePrototype!));
827
+ message.subaccountId = "";
828
+ message.denom = "";
829
+ if (value !== undefined)
830
+ reflectionMergePartial<SubaccountBalanceV2>(this, message, value);
831
+ return message;
832
+ }
833
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubaccountBalanceV2): SubaccountBalanceV2 {
834
+ let message = target ?? this.create(), end = reader.pos + length;
835
+ while (reader.pos < end) {
836
+ let [fieldNo, wireType] = reader.tag();
837
+ switch (fieldNo) {
838
+ case /* string subaccount_id */ 1:
839
+ message.subaccountId = reader.string();
840
+ break;
841
+ case /* string denom */ 2:
842
+ message.denom = reader.string();
843
+ break;
844
+ case /* injective_portfolio_rpc.SubaccountDeposit deposit */ 3:
845
+ message.deposit = SubaccountDeposit.internalBinaryRead(reader, reader.uint32(), options, message.deposit);
846
+ break;
847
+ default:
848
+ let u = options.readUnknownField;
849
+ if (u === "throw")
850
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
851
+ let d = reader.skip(wireType);
852
+ if (u !== false)
853
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
854
+ }
855
+ }
856
+ return message;
857
+ }
858
+ internalBinaryWrite(message: SubaccountBalanceV2, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
859
+ /* string subaccount_id = 1; */
860
+ if (message.subaccountId !== "")
861
+ writer.tag(1, WireType.LengthDelimited).string(message.subaccountId);
862
+ /* string denom = 2; */
863
+ if (message.denom !== "")
864
+ writer.tag(2, WireType.LengthDelimited).string(message.denom);
865
+ /* injective_portfolio_rpc.SubaccountDeposit deposit = 3; */
866
+ if (message.deposit)
867
+ SubaccountDeposit.internalBinaryWrite(message.deposit, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
868
+ let u = options.writeUnknownFields;
869
+ if (u !== false)
870
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
871
+ return writer;
872
+ }
873
+ }
874
+ /**
875
+ * @generated MessageType for protobuf message injective_portfolio_rpc.SubaccountBalanceV2
876
+ */
877
+ export const SubaccountBalanceV2 = new SubaccountBalanceV2$Type();
878
+ // @generated message type with reflection information, may provide speed optimized methods
879
+ class SubaccountDeposit$Type extends MessageType<SubaccountDeposit> {
880
+ constructor() {
881
+ super("injective_portfolio_rpc.SubaccountDeposit", [
882
+ { no: 1, name: "total_balance", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
883
+ { no: 2, name: "available_balance", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
884
+ { no: 3, name: "total_balance_usd", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
885
+ { no: 4, name: "available_balance_usd", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
886
+ ]);
887
+ }
888
+ create(value?: PartialMessage<SubaccountDeposit>): SubaccountDeposit {
889
+ const message = globalThis.Object.create((this.messagePrototype!));
890
+ message.totalBalance = "";
891
+ message.availableBalance = "";
892
+ message.totalBalanceUsd = "";
893
+ message.availableBalanceUsd = "";
894
+ if (value !== undefined)
895
+ reflectionMergePartial<SubaccountDeposit>(this, message, value);
896
+ return message;
897
+ }
898
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubaccountDeposit): SubaccountDeposit {
899
+ let message = target ?? this.create(), end = reader.pos + length;
900
+ while (reader.pos < end) {
901
+ let [fieldNo, wireType] = reader.tag();
902
+ switch (fieldNo) {
903
+ case /* string total_balance */ 1:
904
+ message.totalBalance = reader.string();
905
+ break;
906
+ case /* string available_balance */ 2:
907
+ message.availableBalance = reader.string();
908
+ break;
909
+ case /* string total_balance_usd */ 3:
910
+ message.totalBalanceUsd = reader.string();
911
+ break;
912
+ case /* string available_balance_usd */ 4:
913
+ message.availableBalanceUsd = reader.string();
914
+ break;
915
+ default:
916
+ let u = options.readUnknownField;
917
+ if (u === "throw")
918
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
919
+ let d = reader.skip(wireType);
920
+ if (u !== false)
921
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
922
+ }
923
+ }
924
+ return message;
925
+ }
926
+ internalBinaryWrite(message: SubaccountDeposit, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
927
+ /* string total_balance = 1; */
928
+ if (message.totalBalance !== "")
929
+ writer.tag(1, WireType.LengthDelimited).string(message.totalBalance);
930
+ /* string available_balance = 2; */
931
+ if (message.availableBalance !== "")
932
+ writer.tag(2, WireType.LengthDelimited).string(message.availableBalance);
933
+ /* string total_balance_usd = 3; */
934
+ if (message.totalBalanceUsd !== "")
935
+ writer.tag(3, WireType.LengthDelimited).string(message.totalBalanceUsd);
936
+ /* string available_balance_usd = 4; */
937
+ if (message.availableBalanceUsd !== "")
938
+ writer.tag(4, WireType.LengthDelimited).string(message.availableBalanceUsd);
939
+ let u = options.writeUnknownFields;
940
+ if (u !== false)
941
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
942
+ return writer;
943
+ }
944
+ }
945
+ /**
946
+ * @generated MessageType for protobuf message injective_portfolio_rpc.SubaccountDeposit
947
+ */
948
+ export const SubaccountDeposit = new SubaccountDeposit$Type();
949
+ // @generated message type with reflection information, may provide speed optimized methods
950
+ class PositionsWithUPNL$Type extends MessageType<PositionsWithUPNL> {
951
+ constructor() {
952
+ super("injective_portfolio_rpc.PositionsWithUPNL", [
953
+ { no: 1, name: "position", kind: "message", T: () => DerivativePosition },
954
+ { no: 2, name: "unrealized_pnl", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
955
+ ]);
956
+ }
957
+ create(value?: PartialMessage<PositionsWithUPNL>): PositionsWithUPNL {
958
+ const message = globalThis.Object.create((this.messagePrototype!));
959
+ message.unrealizedPnl = "";
960
+ if (value !== undefined)
961
+ reflectionMergePartial<PositionsWithUPNL>(this, message, value);
962
+ return message;
963
+ }
964
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PositionsWithUPNL): PositionsWithUPNL {
965
+ let message = target ?? this.create(), end = reader.pos + length;
966
+ while (reader.pos < end) {
967
+ let [fieldNo, wireType] = reader.tag();
968
+ switch (fieldNo) {
969
+ case /* injective_portfolio_rpc.DerivativePosition position */ 1:
970
+ message.position = DerivativePosition.internalBinaryRead(reader, reader.uint32(), options, message.position);
971
+ break;
972
+ case /* string unrealized_pnl */ 2:
973
+ message.unrealizedPnl = reader.string();
974
+ break;
975
+ default:
976
+ let u = options.readUnknownField;
977
+ if (u === "throw")
978
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
979
+ let d = reader.skip(wireType);
980
+ if (u !== false)
981
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
982
+ }
983
+ }
984
+ return message;
985
+ }
986
+ internalBinaryWrite(message: PositionsWithUPNL, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
987
+ /* injective_portfolio_rpc.DerivativePosition position = 1; */
988
+ if (message.position)
989
+ DerivativePosition.internalBinaryWrite(message.position, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
990
+ /* string unrealized_pnl = 2; */
991
+ if (message.unrealizedPnl !== "")
992
+ writer.tag(2, WireType.LengthDelimited).string(message.unrealizedPnl);
993
+ let u = options.writeUnknownFields;
994
+ if (u !== false)
995
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
996
+ return writer;
997
+ }
998
+ }
999
+ /**
1000
+ * @generated MessageType for protobuf message injective_portfolio_rpc.PositionsWithUPNL
1001
+ */
1002
+ export const PositionsWithUPNL = new PositionsWithUPNL$Type();
1003
+ // @generated message type with reflection information, may provide speed optimized methods
1004
+ class DerivativePosition$Type extends MessageType<DerivativePosition> {
1005
+ constructor() {
1006
+ super("injective_portfolio_rpc.DerivativePosition", [
1007
+ { no: 1, name: "ticker", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1008
+ { no: 2, name: "market_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1009
+ { no: 3, name: "subaccount_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1010
+ { no: 4, name: "direction", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1011
+ { no: 5, name: "quantity", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1012
+ { no: 6, name: "entry_price", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1013
+ { no: 7, name: "margin", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1014
+ { no: 8, name: "liquidation_price", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1015
+ { no: 9, name: "mark_price", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1016
+ { no: 11, name: "aggregate_reduce_only_quantity", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1017
+ { no: 12, name: "updated_at", kind: "scalar", T: 18 /*ScalarType.SINT64*/, L: 0 /*LongType.BIGINT*/ },
1018
+ { no: 13, name: "created_at", kind: "scalar", T: 18 /*ScalarType.SINT64*/, L: 0 /*LongType.BIGINT*/ },
1019
+ { no: 14, name: "funding_last", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1020
+ { no: 15, name: "funding_sum", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1021
+ { no: 16, name: "cumulative_funding_entry", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1022
+ { no: 17, name: "effective_cumulative_funding_entry", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1023
+ ]);
1024
+ }
1025
+ create(value?: PartialMessage<DerivativePosition>): DerivativePosition {
1026
+ const message = globalThis.Object.create((this.messagePrototype!));
1027
+ message.ticker = "";
1028
+ message.marketId = "";
1029
+ message.subaccountId = "";
1030
+ message.direction = "";
1031
+ message.quantity = "";
1032
+ message.entryPrice = "";
1033
+ message.margin = "";
1034
+ message.liquidationPrice = "";
1035
+ message.markPrice = "";
1036
+ message.aggregateReduceOnlyQuantity = "";
1037
+ message.updatedAt = 0n;
1038
+ message.createdAt = 0n;
1039
+ message.fundingLast = "";
1040
+ message.fundingSum = "";
1041
+ message.cumulativeFundingEntry = "";
1042
+ message.effectiveCumulativeFundingEntry = "";
1043
+ if (value !== undefined)
1044
+ reflectionMergePartial<DerivativePosition>(this, message, value);
1045
+ return message;
1046
+ }
1047
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DerivativePosition): DerivativePosition {
1048
+ let message = target ?? this.create(), end = reader.pos + length;
1049
+ while (reader.pos < end) {
1050
+ let [fieldNo, wireType] = reader.tag();
1051
+ switch (fieldNo) {
1052
+ case /* string ticker */ 1:
1053
+ message.ticker = reader.string();
1054
+ break;
1055
+ case /* string market_id */ 2:
1056
+ message.marketId = reader.string();
1057
+ break;
1058
+ case /* string subaccount_id */ 3:
1059
+ message.subaccountId = reader.string();
1060
+ break;
1061
+ case /* string direction */ 4:
1062
+ message.direction = reader.string();
1063
+ break;
1064
+ case /* string quantity */ 5:
1065
+ message.quantity = reader.string();
1066
+ break;
1067
+ case /* string entry_price */ 6:
1068
+ message.entryPrice = reader.string();
1069
+ break;
1070
+ case /* string margin */ 7:
1071
+ message.margin = reader.string();
1072
+ break;
1073
+ case /* string liquidation_price */ 8:
1074
+ message.liquidationPrice = reader.string();
1075
+ break;
1076
+ case /* string mark_price */ 9:
1077
+ message.markPrice = reader.string();
1078
+ break;
1079
+ case /* string aggregate_reduce_only_quantity */ 11:
1080
+ message.aggregateReduceOnlyQuantity = reader.string();
1081
+ break;
1082
+ case /* sint64 updated_at */ 12:
1083
+ message.updatedAt = reader.sint64().toBigInt();
1084
+ break;
1085
+ case /* sint64 created_at */ 13:
1086
+ message.createdAt = reader.sint64().toBigInt();
1087
+ break;
1088
+ case /* string funding_last */ 14:
1089
+ message.fundingLast = reader.string();
1090
+ break;
1091
+ case /* string funding_sum */ 15:
1092
+ message.fundingSum = reader.string();
1093
+ break;
1094
+ case /* string cumulative_funding_entry */ 16:
1095
+ message.cumulativeFundingEntry = reader.string();
1096
+ break;
1097
+ case /* string effective_cumulative_funding_entry */ 17:
1098
+ message.effectiveCumulativeFundingEntry = reader.string();
1099
+ break;
1100
+ default:
1101
+ let u = options.readUnknownField;
1102
+ if (u === "throw")
1103
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1104
+ let d = reader.skip(wireType);
1105
+ if (u !== false)
1106
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1107
+ }
1108
+ }
1109
+ return message;
1110
+ }
1111
+ internalBinaryWrite(message: DerivativePosition, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1112
+ /* string ticker = 1; */
1113
+ if (message.ticker !== "")
1114
+ writer.tag(1, WireType.LengthDelimited).string(message.ticker);
1115
+ /* string market_id = 2; */
1116
+ if (message.marketId !== "")
1117
+ writer.tag(2, WireType.LengthDelimited).string(message.marketId);
1118
+ /* string subaccount_id = 3; */
1119
+ if (message.subaccountId !== "")
1120
+ writer.tag(3, WireType.LengthDelimited).string(message.subaccountId);
1121
+ /* string direction = 4; */
1122
+ if (message.direction !== "")
1123
+ writer.tag(4, WireType.LengthDelimited).string(message.direction);
1124
+ /* string quantity = 5; */
1125
+ if (message.quantity !== "")
1126
+ writer.tag(5, WireType.LengthDelimited).string(message.quantity);
1127
+ /* string entry_price = 6; */
1128
+ if (message.entryPrice !== "")
1129
+ writer.tag(6, WireType.LengthDelimited).string(message.entryPrice);
1130
+ /* string margin = 7; */
1131
+ if (message.margin !== "")
1132
+ writer.tag(7, WireType.LengthDelimited).string(message.margin);
1133
+ /* string liquidation_price = 8; */
1134
+ if (message.liquidationPrice !== "")
1135
+ writer.tag(8, WireType.LengthDelimited).string(message.liquidationPrice);
1136
+ /* string mark_price = 9; */
1137
+ if (message.markPrice !== "")
1138
+ writer.tag(9, WireType.LengthDelimited).string(message.markPrice);
1139
+ /* string aggregate_reduce_only_quantity = 11; */
1140
+ if (message.aggregateReduceOnlyQuantity !== "")
1141
+ writer.tag(11, WireType.LengthDelimited).string(message.aggregateReduceOnlyQuantity);
1142
+ /* sint64 updated_at = 12; */
1143
+ if (message.updatedAt !== 0n)
1144
+ writer.tag(12, WireType.Varint).sint64(message.updatedAt);
1145
+ /* sint64 created_at = 13; */
1146
+ if (message.createdAt !== 0n)
1147
+ writer.tag(13, WireType.Varint).sint64(message.createdAt);
1148
+ /* string funding_last = 14; */
1149
+ if (message.fundingLast !== "")
1150
+ writer.tag(14, WireType.LengthDelimited).string(message.fundingLast);
1151
+ /* string funding_sum = 15; */
1152
+ if (message.fundingSum !== "")
1153
+ writer.tag(15, WireType.LengthDelimited).string(message.fundingSum);
1154
+ /* string cumulative_funding_entry = 16; */
1155
+ if (message.cumulativeFundingEntry !== "")
1156
+ writer.tag(16, WireType.LengthDelimited).string(message.cumulativeFundingEntry);
1157
+ /* string effective_cumulative_funding_entry = 17; */
1158
+ if (message.effectiveCumulativeFundingEntry !== "")
1159
+ writer.tag(17, WireType.LengthDelimited).string(message.effectiveCumulativeFundingEntry);
1160
+ let u = options.writeUnknownFields;
1161
+ if (u !== false)
1162
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1163
+ return writer;
1164
+ }
1165
+ }
1166
+ /**
1167
+ * @generated MessageType for protobuf message injective_portfolio_rpc.DerivativePosition
1168
+ */
1169
+ export const DerivativePosition = new DerivativePosition$Type();
1170
+ // @generated message type with reflection information, may provide speed optimized methods
1171
+ class AccountPortfolioBalancesRequest$Type extends MessageType<AccountPortfolioBalancesRequest> {
1172
+ constructor() {
1173
+ super("injective_portfolio_rpc.AccountPortfolioBalancesRequest", [
1174
+ { no: 1, name: "account_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1175
+ { no: 2, name: "usd", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
1176
+ ]);
1177
+ }
1178
+ create(value?: PartialMessage<AccountPortfolioBalancesRequest>): AccountPortfolioBalancesRequest {
1179
+ const message = globalThis.Object.create((this.messagePrototype!));
1180
+ message.accountAddress = "";
1181
+ message.usd = false;
1182
+ if (value !== undefined)
1183
+ reflectionMergePartial<AccountPortfolioBalancesRequest>(this, message, value);
1184
+ return message;
1185
+ }
1186
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AccountPortfolioBalancesRequest): AccountPortfolioBalancesRequest {
1187
+ let message = target ?? this.create(), end = reader.pos + length;
1188
+ while (reader.pos < end) {
1189
+ let [fieldNo, wireType] = reader.tag();
1190
+ switch (fieldNo) {
1191
+ case /* string account_address */ 1:
1192
+ message.accountAddress = reader.string();
1193
+ break;
1194
+ case /* bool usd */ 2:
1195
+ message.usd = reader.bool();
1196
+ break;
1197
+ default:
1198
+ let u = options.readUnknownField;
1199
+ if (u === "throw")
1200
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1201
+ let d = reader.skip(wireType);
1202
+ if (u !== false)
1203
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1204
+ }
1205
+ }
1206
+ return message;
1207
+ }
1208
+ internalBinaryWrite(message: AccountPortfolioBalancesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1209
+ /* string account_address = 1; */
1210
+ if (message.accountAddress !== "")
1211
+ writer.tag(1, WireType.LengthDelimited).string(message.accountAddress);
1212
+ /* bool usd = 2; */
1213
+ if (message.usd !== false)
1214
+ writer.tag(2, WireType.Varint).bool(message.usd);
1215
+ let u = options.writeUnknownFields;
1216
+ if (u !== false)
1217
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1218
+ return writer;
1219
+ }
1220
+ }
1221
+ /**
1222
+ * @generated MessageType for protobuf message injective_portfolio_rpc.AccountPortfolioBalancesRequest
1223
+ */
1224
+ export const AccountPortfolioBalancesRequest = new AccountPortfolioBalancesRequest$Type();
1225
+ // @generated message type with reflection information, may provide speed optimized methods
1226
+ class AccountPortfolioBalancesResponse$Type extends MessageType<AccountPortfolioBalancesResponse> {
1227
+ constructor() {
1228
+ super("injective_portfolio_rpc.AccountPortfolioBalancesResponse", [
1229
+ { no: 1, name: "portfolio", kind: "message", T: () => PortfolioBalances }
1230
+ ]);
1231
+ }
1232
+ create(value?: PartialMessage<AccountPortfolioBalancesResponse>): AccountPortfolioBalancesResponse {
1233
+ const message = globalThis.Object.create((this.messagePrototype!));
1234
+ if (value !== undefined)
1235
+ reflectionMergePartial<AccountPortfolioBalancesResponse>(this, message, value);
1236
+ return message;
1237
+ }
1238
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AccountPortfolioBalancesResponse): AccountPortfolioBalancesResponse {
1239
+ let message = target ?? this.create(), end = reader.pos + length;
1240
+ while (reader.pos < end) {
1241
+ let [fieldNo, wireType] = reader.tag();
1242
+ switch (fieldNo) {
1243
+ case /* injective_portfolio_rpc.PortfolioBalances portfolio */ 1:
1244
+ message.portfolio = PortfolioBalances.internalBinaryRead(reader, reader.uint32(), options, message.portfolio);
1245
+ break;
1246
+ default:
1247
+ let u = options.readUnknownField;
1248
+ if (u === "throw")
1249
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1250
+ let d = reader.skip(wireType);
1251
+ if (u !== false)
1252
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1253
+ }
1254
+ }
1255
+ return message;
1256
+ }
1257
+ internalBinaryWrite(message: AccountPortfolioBalancesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1258
+ /* injective_portfolio_rpc.PortfolioBalances portfolio = 1; */
1259
+ if (message.portfolio)
1260
+ PortfolioBalances.internalBinaryWrite(message.portfolio, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
1261
+ let u = options.writeUnknownFields;
1262
+ if (u !== false)
1263
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1264
+ return writer;
1265
+ }
1266
+ }
1267
+ /**
1268
+ * @generated MessageType for protobuf message injective_portfolio_rpc.AccountPortfolioBalancesResponse
1269
+ */
1270
+ export const AccountPortfolioBalancesResponse = new AccountPortfolioBalancesResponse$Type();
1271
+ // @generated message type with reflection information, may provide speed optimized methods
1272
+ class PortfolioBalances$Type extends MessageType<PortfolioBalances> {
1273
+ constructor() {
1274
+ super("injective_portfolio_rpc.PortfolioBalances", [
1275
+ { no: 1, name: "account_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1276
+ { no: 2, name: "bank_balances", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Coin },
1277
+ { no: 3, name: "subaccounts", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => SubaccountBalanceV2 },
1278
+ { no: 4, name: "total_usd", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1279
+ ]);
1280
+ }
1281
+ create(value?: PartialMessage<PortfolioBalances>): PortfolioBalances {
1282
+ const message = globalThis.Object.create((this.messagePrototype!));
1283
+ message.accountAddress = "";
1284
+ message.bankBalances = [];
1285
+ message.subaccounts = [];
1286
+ message.totalUsd = "";
1287
+ if (value !== undefined)
1288
+ reflectionMergePartial<PortfolioBalances>(this, message, value);
1289
+ return message;
1290
+ }
1291
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PortfolioBalances): PortfolioBalances {
1292
+ let message = target ?? this.create(), end = reader.pos + length;
1293
+ while (reader.pos < end) {
1294
+ let [fieldNo, wireType] = reader.tag();
1295
+ switch (fieldNo) {
1296
+ case /* string account_address */ 1:
1297
+ message.accountAddress = reader.string();
1298
+ break;
1299
+ case /* repeated injective_portfolio_rpc.Coin bank_balances */ 2:
1300
+ message.bankBalances.push(Coin.internalBinaryRead(reader, reader.uint32(), options));
1301
+ break;
1302
+ case /* repeated injective_portfolio_rpc.SubaccountBalanceV2 subaccounts */ 3:
1303
+ message.subaccounts.push(SubaccountBalanceV2.internalBinaryRead(reader, reader.uint32(), options));
1304
+ break;
1305
+ case /* string total_usd */ 4:
1306
+ message.totalUsd = reader.string();
1307
+ break;
1308
+ default:
1309
+ let u = options.readUnknownField;
1310
+ if (u === "throw")
1311
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1312
+ let d = reader.skip(wireType);
1313
+ if (u !== false)
1314
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1315
+ }
1316
+ }
1317
+ return message;
1318
+ }
1319
+ internalBinaryWrite(message: PortfolioBalances, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1320
+ /* string account_address = 1; */
1321
+ if (message.accountAddress !== "")
1322
+ writer.tag(1, WireType.LengthDelimited).string(message.accountAddress);
1323
+ /* repeated injective_portfolio_rpc.Coin bank_balances = 2; */
1324
+ for (let i = 0; i < message.bankBalances.length; i++)
1325
+ Coin.internalBinaryWrite(message.bankBalances[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
1326
+ /* repeated injective_portfolio_rpc.SubaccountBalanceV2 subaccounts = 3; */
1327
+ for (let i = 0; i < message.subaccounts.length; i++)
1328
+ SubaccountBalanceV2.internalBinaryWrite(message.subaccounts[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
1329
+ /* string total_usd = 4; */
1330
+ if (message.totalUsd !== "")
1331
+ writer.tag(4, WireType.LengthDelimited).string(message.totalUsd);
1332
+ let u = options.writeUnknownFields;
1333
+ if (u !== false)
1334
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1335
+ return writer;
1336
+ }
1337
+ }
1338
+ /**
1339
+ * @generated MessageType for protobuf message injective_portfolio_rpc.PortfolioBalances
1340
+ */
1341
+ export const PortfolioBalances = new PortfolioBalances$Type();
1342
+ // @generated message type with reflection information, may provide speed optimized methods
1343
+ class StreamAccountPortfolioRequest$Type extends MessageType<StreamAccountPortfolioRequest> {
1344
+ constructor() {
1345
+ super("injective_portfolio_rpc.StreamAccountPortfolioRequest", [
1346
+ { no: 1, name: "account_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1347
+ { no: 2, name: "subaccount_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1348
+ { no: 3, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
1349
+ ]);
1350
+ }
1351
+ create(value?: PartialMessage<StreamAccountPortfolioRequest>): StreamAccountPortfolioRequest {
1352
+ const message = globalThis.Object.create((this.messagePrototype!));
1353
+ message.accountAddress = "";
1354
+ message.subaccountId = "";
1355
+ message.type = "";
1356
+ if (value !== undefined)
1357
+ reflectionMergePartial<StreamAccountPortfolioRequest>(this, message, value);
1358
+ return message;
1359
+ }
1360
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StreamAccountPortfolioRequest): StreamAccountPortfolioRequest {
1361
+ let message = target ?? this.create(), end = reader.pos + length;
1362
+ while (reader.pos < end) {
1363
+ let [fieldNo, wireType] = reader.tag();
1364
+ switch (fieldNo) {
1365
+ case /* string account_address */ 1:
1366
+ message.accountAddress = reader.string();
1367
+ break;
1368
+ case /* string subaccount_id */ 2:
1369
+ message.subaccountId = reader.string();
1370
+ break;
1371
+ case /* string type */ 3:
1372
+ message.type = reader.string();
1373
+ break;
1374
+ default:
1375
+ let u = options.readUnknownField;
1376
+ if (u === "throw")
1377
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1378
+ let d = reader.skip(wireType);
1379
+ if (u !== false)
1380
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1381
+ }
1382
+ }
1383
+ return message;
1384
+ }
1385
+ internalBinaryWrite(message: StreamAccountPortfolioRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1386
+ /* string account_address = 1; */
1387
+ if (message.accountAddress !== "")
1388
+ writer.tag(1, WireType.LengthDelimited).string(message.accountAddress);
1389
+ /* string subaccount_id = 2; */
1390
+ if (message.subaccountId !== "")
1391
+ writer.tag(2, WireType.LengthDelimited).string(message.subaccountId);
1392
+ /* string type = 3; */
1393
+ if (message.type !== "")
1394
+ writer.tag(3, WireType.LengthDelimited).string(message.type);
1395
+ let u = options.writeUnknownFields;
1396
+ if (u !== false)
1397
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1398
+ return writer;
1399
+ }
1400
+ }
1401
+ /**
1402
+ * @generated MessageType for protobuf message injective_portfolio_rpc.StreamAccountPortfolioRequest
1403
+ */
1404
+ export const StreamAccountPortfolioRequest = new StreamAccountPortfolioRequest$Type();
1405
+ // @generated message type with reflection information, may provide speed optimized methods
1406
+ class StreamAccountPortfolioResponse$Type extends MessageType<StreamAccountPortfolioResponse> {
1407
+ constructor() {
1408
+ super("injective_portfolio_rpc.StreamAccountPortfolioResponse", [
1409
+ { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1410
+ { no: 2, name: "denom", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1411
+ { no: 3, name: "amount", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1412
+ { no: 4, name: "subaccount_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
1413
+ { no: 5, name: "timestamp", kind: "scalar", T: 18 /*ScalarType.SINT64*/, L: 0 /*LongType.BIGINT*/ }
1414
+ ]);
1415
+ }
1416
+ create(value?: PartialMessage<StreamAccountPortfolioResponse>): StreamAccountPortfolioResponse {
1417
+ const message = globalThis.Object.create((this.messagePrototype!));
1418
+ message.type = "";
1419
+ message.denom = "";
1420
+ message.amount = "";
1421
+ message.subaccountId = "";
1422
+ message.timestamp = 0n;
1423
+ if (value !== undefined)
1424
+ reflectionMergePartial<StreamAccountPortfolioResponse>(this, message, value);
1425
+ return message;
1426
+ }
1427
+ internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StreamAccountPortfolioResponse): StreamAccountPortfolioResponse {
1428
+ let message = target ?? this.create(), end = reader.pos + length;
1429
+ while (reader.pos < end) {
1430
+ let [fieldNo, wireType] = reader.tag();
1431
+ switch (fieldNo) {
1432
+ case /* string type */ 1:
1433
+ message.type = reader.string();
1434
+ break;
1435
+ case /* string denom */ 2:
1436
+ message.denom = reader.string();
1437
+ break;
1438
+ case /* string amount */ 3:
1439
+ message.amount = reader.string();
1440
+ break;
1441
+ case /* string subaccount_id */ 4:
1442
+ message.subaccountId = reader.string();
1443
+ break;
1444
+ case /* sint64 timestamp */ 5:
1445
+ message.timestamp = reader.sint64().toBigInt();
1446
+ break;
1447
+ default:
1448
+ let u = options.readUnknownField;
1449
+ if (u === "throw")
1450
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
1451
+ let d = reader.skip(wireType);
1452
+ if (u !== false)
1453
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
1454
+ }
1455
+ }
1456
+ return message;
1457
+ }
1458
+ internalBinaryWrite(message: StreamAccountPortfolioResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
1459
+ /* string type = 1; */
1460
+ if (message.type !== "")
1461
+ writer.tag(1, WireType.LengthDelimited).string(message.type);
1462
+ /* string denom = 2; */
1463
+ if (message.denom !== "")
1464
+ writer.tag(2, WireType.LengthDelimited).string(message.denom);
1465
+ /* string amount = 3; */
1466
+ if (message.amount !== "")
1467
+ writer.tag(3, WireType.LengthDelimited).string(message.amount);
1468
+ /* string subaccount_id = 4; */
1469
+ if (message.subaccountId !== "")
1470
+ writer.tag(4, WireType.LengthDelimited).string(message.subaccountId);
1471
+ /* sint64 timestamp = 5; */
1472
+ if (message.timestamp !== 0n)
1473
+ writer.tag(5, WireType.Varint).sint64(message.timestamp);
1474
+ let u = options.writeUnknownFields;
1475
+ if (u !== false)
1476
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
1477
+ return writer;
1478
+ }
1479
+ }
1480
+ /**
1481
+ * @generated MessageType for protobuf message injective_portfolio_rpc.StreamAccountPortfolioResponse
1482
+ */
1483
+ export const StreamAccountPortfolioResponse = new StreamAccountPortfolioResponse$Type();
1484
+ /**
1485
+ * @generated ServiceType for protobuf service injective_portfolio_rpc.InjectivePortfolioRPC
1486
+ */
1487
+ export const InjectivePortfolioRPC = new ServiceType("injective_portfolio_rpc.InjectivePortfolioRPC", [
1488
+ { name: "TokenHolders", options: {}, I: TokenHoldersRequest, O: TokenHoldersResponse },
1489
+ { name: "AccountPortfolio", options: {}, I: AccountPortfolioRequest, O: AccountPortfolioResponse },
1490
+ { name: "AccountPortfolioBalances", options: {}, I: AccountPortfolioBalancesRequest, O: AccountPortfolioBalancesResponse },
1491
+ { name: "StreamAccountPortfolio", serverStreaming: true, options: {}, I: StreamAccountPortfolioRequest, O: StreamAccountPortfolioResponse }
1492
+ ]);