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