@miradorlabs/web-grpc 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 (33) hide show
  1. package/README.md +5 -0
  2. package/google/protobuf/timestamp.ts +229 -0
  3. package/package.json +11 -0
  4. package/proto/gateway/common/v1/status.ts +179 -0
  5. package/proto/gateway/common/v1/status_grpc_pb.js +1 -0
  6. package/proto/gateway/common/v1/status_pb.js +237 -0
  7. package/proto/gateway/common/v1/types.ts +176 -0
  8. package/proto/gateway/common/v1/types_grpc_pb.js +1 -0
  9. package/proto/gateway/common/v1/types_pb.js +216 -0
  10. package/proto/gateway/web/v1/account_gateway.ts +7037 -0
  11. package/proto/gateway/web/v1/account_gateway_grpc_pb.js +813 -0
  12. package/proto/gateway/web/v1/account_gateway_pb.js +14338 -0
  13. package/proto/gateway/web/v1/automation_gateway.ts +5605 -0
  14. package/proto/gateway/web/v1/automation_gateway_grpc_pb.js +485 -0
  15. package/proto/gateway/web/v1/automation_gateway_pb.js +11618 -0
  16. package/proto/gateway/web/v1/chain_gateway.ts +3805 -0
  17. package/proto/gateway/web/v1/chain_gateway_grpc_pb.js +115 -0
  18. package/proto/gateway/web/v1/chain_gateway_pb.js +7049 -0
  19. package/proto/gateway/web/v1/market_gateway.ts +492 -0
  20. package/proto/gateway/web/v1/market_gateway_grpc_pb.js +45 -0
  21. package/proto/gateway/web/v1/market_gateway_pb.js +1063 -0
  22. package/proto/gateway/web/v1/oauth_gateway.ts +1163 -0
  23. package/proto/gateway/web/v1/oauth_gateway_grpc_pb.js +150 -0
  24. package/proto/gateway/web/v1/oauth_gateway_pb.js +2316 -0
  25. package/proto/gateway/web/v1/plan_gateway.ts +2463 -0
  26. package/proto/gateway/web/v1/plan_gateway_grpc_pb.js +152 -0
  27. package/proto/gateway/web/v1/plan_gateway_pb.js +4840 -0
  28. package/proto/gateway/web/v1/stream_gateway.ts +2354 -0
  29. package/proto/gateway/web/v1/stream_gateway_grpc_pb.js +145 -0
  30. package/proto/gateway/web/v1/stream_gateway_pb.js +4593 -0
  31. package/proto/gateway/web/v1/trace_gateway.ts +16320 -0
  32. package/proto/gateway/web/v1/trace_gateway_grpc_pb.js +280 -0
  33. package/proto/gateway/web/v1/trace_gateway_pb.js +28667 -0
@@ -0,0 +1,2354 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc v3.21.12
5
+ // source: proto/gateway/web/v1/stream_gateway.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+ import type { Metadata } from "@grpc/grpc-js";
10
+ import { Observable } from "rxjs";
11
+ import { map } from "rxjs/operators";
12
+ import { Timestamp } from "../../../../google/protobuf/timestamp";
13
+ import { ChainDetails } from "../../common/v1/types";
14
+
15
+ export const protobufPackage = "gateway.web.v1";
16
+
17
+ export enum SafeTransactionEventType {
18
+ SAFE_TRANSACTION_EVENT_TYPE_UNSPECIFIED = 0,
19
+ SAFE_TRANSACTION_EVENT_TYPE_NEW_CONFIRMATION = 1,
20
+ SAFE_TRANSACTION_EVENT_TYPE_EXECUTED = 2,
21
+ SAFE_TRANSACTION_EVENT_TYPE_PENDING = 3,
22
+ SAFE_TRANSACTION_EVENT_TYPE_DELETED = 4,
23
+ SAFE_TRANSACTION_EVENT_TYPE_CONFIRMATION_REQUEST = 5,
24
+ UNRECOGNIZED = -1,
25
+ }
26
+
27
+ export function safeTransactionEventTypeFromJSON(object: any): SafeTransactionEventType {
28
+ switch (object) {
29
+ case 0:
30
+ case "SAFE_TRANSACTION_EVENT_TYPE_UNSPECIFIED":
31
+ return SafeTransactionEventType.SAFE_TRANSACTION_EVENT_TYPE_UNSPECIFIED;
32
+ case 1:
33
+ case "SAFE_TRANSACTION_EVENT_TYPE_NEW_CONFIRMATION":
34
+ return SafeTransactionEventType.SAFE_TRANSACTION_EVENT_TYPE_NEW_CONFIRMATION;
35
+ case 2:
36
+ case "SAFE_TRANSACTION_EVENT_TYPE_EXECUTED":
37
+ return SafeTransactionEventType.SAFE_TRANSACTION_EVENT_TYPE_EXECUTED;
38
+ case 3:
39
+ case "SAFE_TRANSACTION_EVENT_TYPE_PENDING":
40
+ return SafeTransactionEventType.SAFE_TRANSACTION_EVENT_TYPE_PENDING;
41
+ case 4:
42
+ case "SAFE_TRANSACTION_EVENT_TYPE_DELETED":
43
+ return SafeTransactionEventType.SAFE_TRANSACTION_EVENT_TYPE_DELETED;
44
+ case 5:
45
+ case "SAFE_TRANSACTION_EVENT_TYPE_CONFIRMATION_REQUEST":
46
+ return SafeTransactionEventType.SAFE_TRANSACTION_EVENT_TYPE_CONFIRMATION_REQUEST;
47
+ case -1:
48
+ case "UNRECOGNIZED":
49
+ default:
50
+ return SafeTransactionEventType.UNRECOGNIZED;
51
+ }
52
+ }
53
+
54
+ export function safeTransactionEventTypeToJSON(object: SafeTransactionEventType): string {
55
+ switch (object) {
56
+ case SafeTransactionEventType.SAFE_TRANSACTION_EVENT_TYPE_UNSPECIFIED:
57
+ return "SAFE_TRANSACTION_EVENT_TYPE_UNSPECIFIED";
58
+ case SafeTransactionEventType.SAFE_TRANSACTION_EVENT_TYPE_NEW_CONFIRMATION:
59
+ return "SAFE_TRANSACTION_EVENT_TYPE_NEW_CONFIRMATION";
60
+ case SafeTransactionEventType.SAFE_TRANSACTION_EVENT_TYPE_EXECUTED:
61
+ return "SAFE_TRANSACTION_EVENT_TYPE_EXECUTED";
62
+ case SafeTransactionEventType.SAFE_TRANSACTION_EVENT_TYPE_PENDING:
63
+ return "SAFE_TRANSACTION_EVENT_TYPE_PENDING";
64
+ case SafeTransactionEventType.SAFE_TRANSACTION_EVENT_TYPE_DELETED:
65
+ return "SAFE_TRANSACTION_EVENT_TYPE_DELETED";
66
+ case SafeTransactionEventType.SAFE_TRANSACTION_EVENT_TYPE_CONFIRMATION_REQUEST:
67
+ return "SAFE_TRANSACTION_EVENT_TYPE_CONFIRMATION_REQUEST";
68
+ case SafeTransactionEventType.UNRECOGNIZED:
69
+ default:
70
+ return "UNRECOGNIZED";
71
+ }
72
+ }
73
+
74
+ export enum SafeMessageEventType {
75
+ SAFE_MESSAGE_EVENT_TYPE_UNSPECIFIED = 0,
76
+ SAFE_MESSAGE_EVENT_TYPE_CREATED = 1,
77
+ SAFE_MESSAGE_EVENT_TYPE_CONFIRMED = 2,
78
+ UNRECOGNIZED = -1,
79
+ }
80
+
81
+ export function safeMessageEventTypeFromJSON(object: any): SafeMessageEventType {
82
+ switch (object) {
83
+ case 0:
84
+ case "SAFE_MESSAGE_EVENT_TYPE_UNSPECIFIED":
85
+ return SafeMessageEventType.SAFE_MESSAGE_EVENT_TYPE_UNSPECIFIED;
86
+ case 1:
87
+ case "SAFE_MESSAGE_EVENT_TYPE_CREATED":
88
+ return SafeMessageEventType.SAFE_MESSAGE_EVENT_TYPE_CREATED;
89
+ case 2:
90
+ case "SAFE_MESSAGE_EVENT_TYPE_CONFIRMED":
91
+ return SafeMessageEventType.SAFE_MESSAGE_EVENT_TYPE_CONFIRMED;
92
+ case -1:
93
+ case "UNRECOGNIZED":
94
+ default:
95
+ return SafeMessageEventType.UNRECOGNIZED;
96
+ }
97
+ }
98
+
99
+ export function safeMessageEventTypeToJSON(object: SafeMessageEventType): string {
100
+ switch (object) {
101
+ case SafeMessageEventType.SAFE_MESSAGE_EVENT_TYPE_UNSPECIFIED:
102
+ return "SAFE_MESSAGE_EVENT_TYPE_UNSPECIFIED";
103
+ case SafeMessageEventType.SAFE_MESSAGE_EVENT_TYPE_CREATED:
104
+ return "SAFE_MESSAGE_EVENT_TYPE_CREATED";
105
+ case SafeMessageEventType.SAFE_MESSAGE_EVENT_TYPE_CONFIRMED:
106
+ return "SAFE_MESSAGE_EVENT_TYPE_CONFIRMED";
107
+ case SafeMessageEventType.UNRECOGNIZED:
108
+ default:
109
+ return "UNRECOGNIZED";
110
+ }
111
+ }
112
+
113
+ export interface TokenValue {
114
+ tokenAddress: string;
115
+ symbol: string;
116
+ decimals: number;
117
+ amountRaw: string;
118
+ amountFormatted: string;
119
+ }
120
+
121
+ export interface NativeValue {
122
+ amountRaw: string;
123
+ amountFormatted: string;
124
+ }
125
+
126
+ export interface StreamBridgeMatchesRequest {
127
+ }
128
+
129
+ export interface BridgeMatchEnvelope {
130
+ snapshot?: BridgeMatchSnapshot | undefined;
131
+ update?: BridgeMatchUpdate | undefined;
132
+ }
133
+
134
+ export interface BridgeMatchSnapshot {
135
+ items: BridgeMatchItem[];
136
+ }
137
+
138
+ export interface BridgeMatchUpdate {
139
+ item: BridgeMatchItem | undefined;
140
+ }
141
+
142
+ export interface BridgeMatchItem {
143
+ correlationId: string;
144
+ sourceTxHash: string;
145
+ sourceChainDetails: ChainDetails | undefined;
146
+ destinationTxHash: string;
147
+ destinationChainDetails: ChainDetails | undefined;
148
+ bridgeName: string;
149
+ timestamp: Date | undefined;
150
+ sourceBridgeDescription: string;
151
+ destinationBridgeDescription: string;
152
+ metadata: { [key: string]: string };
153
+ token?: TokenValue | undefined;
154
+ native?: NativeValue | undefined;
155
+ }
156
+
157
+ export interface BridgeMatchItem_MetadataEntry {
158
+ key: string;
159
+ value: string;
160
+ }
161
+
162
+ export interface StreamEvmBlocksRequest {
163
+ /** Required: chain to stream blocks for. */
164
+ evmChainId: number;
165
+ /** When true, recently cached blocks for the chain are replayed before live events begin. */
166
+ includeSnapshot: boolean;
167
+ }
168
+
169
+ export interface EvmBlockStreamItem {
170
+ chainDetails: ChainDetails | undefined;
171
+ blockNumber: number;
172
+ blockHash: string;
173
+ blockTimestamp: Date | undefined;
174
+ parentHash: string;
175
+ createdAt: Date | undefined;
176
+ }
177
+
178
+ export interface StreamSafeMultisigTransactionsRequest {
179
+ }
180
+
181
+ export interface SafeMultisigTransactionEnvelope {
182
+ snapshot?: SafeMultisigTransactionSnapshot | undefined;
183
+ update?: SafeMultisigTransactionUpdate | undefined;
184
+ }
185
+
186
+ export interface SafeMultisigTransactionSnapshot {
187
+ items: SafeMultisigTransactionItem[];
188
+ }
189
+
190
+ export interface SafeMultisigTransactionUpdate {
191
+ item: SafeMultisigTransactionItem | undefined;
192
+ }
193
+
194
+ export interface SafeMultisigTransactionItem {
195
+ safeAddress: string;
196
+ chainDetails: ChainDetails | undefined;
197
+ eventType: SafeTransactionEventType;
198
+ safeTxHash: string;
199
+ publishedAt: Date | undefined;
200
+ rawPayload: Uint8Array;
201
+ }
202
+
203
+ export interface StreamSafeMultisigMessagesRequest {
204
+ }
205
+
206
+ export interface SafeMultisigMessageEnvelope {
207
+ snapshot?: SafeMultisigMessageSnapshot | undefined;
208
+ update?: SafeMultisigMessageUpdate | undefined;
209
+ }
210
+
211
+ export interface SafeMultisigMessageSnapshot {
212
+ items: SafeMultisigMessageItem[];
213
+ }
214
+
215
+ export interface SafeMultisigMessageUpdate {
216
+ item: SafeMultisigMessageItem | undefined;
217
+ }
218
+
219
+ export interface SafeMultisigMessageItem {
220
+ safeAddress: string;
221
+ chainDetails: ChainDetails | undefined;
222
+ eventType: SafeMessageEventType;
223
+ messageHash: string;
224
+ publishedAt: Date | undefined;
225
+ rawPayload: Uint8Array;
226
+ }
227
+
228
+ function createBaseTokenValue(): TokenValue {
229
+ return { tokenAddress: "", symbol: "", decimals: 0, amountRaw: "", amountFormatted: "" };
230
+ }
231
+
232
+ export const TokenValue: MessageFns<TokenValue> = {
233
+ encode(message: TokenValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
234
+ if (message.tokenAddress !== "") {
235
+ writer.uint32(10).string(message.tokenAddress);
236
+ }
237
+ if (message.symbol !== "") {
238
+ writer.uint32(18).string(message.symbol);
239
+ }
240
+ if (message.decimals !== 0) {
241
+ writer.uint32(24).uint32(message.decimals);
242
+ }
243
+ if (message.amountRaw !== "") {
244
+ writer.uint32(34).string(message.amountRaw);
245
+ }
246
+ if (message.amountFormatted !== "") {
247
+ writer.uint32(42).string(message.amountFormatted);
248
+ }
249
+ return writer;
250
+ },
251
+
252
+ decode(input: BinaryReader | Uint8Array, length?: number): TokenValue {
253
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
254
+ const end = length === undefined ? reader.len : reader.pos + length;
255
+ const message = createBaseTokenValue();
256
+ while (reader.pos < end) {
257
+ const tag = reader.uint32();
258
+ switch (tag >>> 3) {
259
+ case 1: {
260
+ if (tag !== 10) {
261
+ break;
262
+ }
263
+
264
+ message.tokenAddress = reader.string();
265
+ continue;
266
+ }
267
+ case 2: {
268
+ if (tag !== 18) {
269
+ break;
270
+ }
271
+
272
+ message.symbol = reader.string();
273
+ continue;
274
+ }
275
+ case 3: {
276
+ if (tag !== 24) {
277
+ break;
278
+ }
279
+
280
+ message.decimals = reader.uint32();
281
+ continue;
282
+ }
283
+ case 4: {
284
+ if (tag !== 34) {
285
+ break;
286
+ }
287
+
288
+ message.amountRaw = reader.string();
289
+ continue;
290
+ }
291
+ case 5: {
292
+ if (tag !== 42) {
293
+ break;
294
+ }
295
+
296
+ message.amountFormatted = reader.string();
297
+ continue;
298
+ }
299
+ }
300
+ if ((tag & 7) === 4 || tag === 0) {
301
+ break;
302
+ }
303
+ reader.skip(tag & 7);
304
+ }
305
+ return message;
306
+ },
307
+
308
+ fromJSON(object: any): TokenValue {
309
+ return {
310
+ tokenAddress: isSet(object.tokenAddress)
311
+ ? globalThis.String(object.tokenAddress)
312
+ : isSet(object.token_address)
313
+ ? globalThis.String(object.token_address)
314
+ : "",
315
+ symbol: isSet(object.symbol) ? globalThis.String(object.symbol) : "",
316
+ decimals: isSet(object.decimals) ? globalThis.Number(object.decimals) : 0,
317
+ amountRaw: isSet(object.amountRaw)
318
+ ? globalThis.String(object.amountRaw)
319
+ : isSet(object.amount_raw)
320
+ ? globalThis.String(object.amount_raw)
321
+ : "",
322
+ amountFormatted: isSet(object.amountFormatted)
323
+ ? globalThis.String(object.amountFormatted)
324
+ : isSet(object.amount_formatted)
325
+ ? globalThis.String(object.amount_formatted)
326
+ : "",
327
+ };
328
+ },
329
+
330
+ toJSON(message: TokenValue): unknown {
331
+ const obj: any = {};
332
+ if (message.tokenAddress !== "") {
333
+ obj.tokenAddress = message.tokenAddress;
334
+ }
335
+ if (message.symbol !== "") {
336
+ obj.symbol = message.symbol;
337
+ }
338
+ if (message.decimals !== 0) {
339
+ obj.decimals = Math.round(message.decimals);
340
+ }
341
+ if (message.amountRaw !== "") {
342
+ obj.amountRaw = message.amountRaw;
343
+ }
344
+ if (message.amountFormatted !== "") {
345
+ obj.amountFormatted = message.amountFormatted;
346
+ }
347
+ return obj;
348
+ },
349
+
350
+ create<I extends Exact<DeepPartial<TokenValue>, I>>(base?: I): TokenValue {
351
+ return TokenValue.fromPartial(base ?? ({} as any));
352
+ },
353
+ fromPartial<I extends Exact<DeepPartial<TokenValue>, I>>(object: I): TokenValue {
354
+ const message = createBaseTokenValue();
355
+ message.tokenAddress = object.tokenAddress ?? "";
356
+ message.symbol = object.symbol ?? "";
357
+ message.decimals = object.decimals ?? 0;
358
+ message.amountRaw = object.amountRaw ?? "";
359
+ message.amountFormatted = object.amountFormatted ?? "";
360
+ return message;
361
+ },
362
+ };
363
+
364
+ function createBaseNativeValue(): NativeValue {
365
+ return { amountRaw: "", amountFormatted: "" };
366
+ }
367
+
368
+ export const NativeValue: MessageFns<NativeValue> = {
369
+ encode(message: NativeValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
370
+ if (message.amountRaw !== "") {
371
+ writer.uint32(10).string(message.amountRaw);
372
+ }
373
+ if (message.amountFormatted !== "") {
374
+ writer.uint32(18).string(message.amountFormatted);
375
+ }
376
+ return writer;
377
+ },
378
+
379
+ decode(input: BinaryReader | Uint8Array, length?: number): NativeValue {
380
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
381
+ const end = length === undefined ? reader.len : reader.pos + length;
382
+ const message = createBaseNativeValue();
383
+ while (reader.pos < end) {
384
+ const tag = reader.uint32();
385
+ switch (tag >>> 3) {
386
+ case 1: {
387
+ if (tag !== 10) {
388
+ break;
389
+ }
390
+
391
+ message.amountRaw = reader.string();
392
+ continue;
393
+ }
394
+ case 2: {
395
+ if (tag !== 18) {
396
+ break;
397
+ }
398
+
399
+ message.amountFormatted = reader.string();
400
+ continue;
401
+ }
402
+ }
403
+ if ((tag & 7) === 4 || tag === 0) {
404
+ break;
405
+ }
406
+ reader.skip(tag & 7);
407
+ }
408
+ return message;
409
+ },
410
+
411
+ fromJSON(object: any): NativeValue {
412
+ return {
413
+ amountRaw: isSet(object.amountRaw)
414
+ ? globalThis.String(object.amountRaw)
415
+ : isSet(object.amount_raw)
416
+ ? globalThis.String(object.amount_raw)
417
+ : "",
418
+ amountFormatted: isSet(object.amountFormatted)
419
+ ? globalThis.String(object.amountFormatted)
420
+ : isSet(object.amount_formatted)
421
+ ? globalThis.String(object.amount_formatted)
422
+ : "",
423
+ };
424
+ },
425
+
426
+ toJSON(message: NativeValue): unknown {
427
+ const obj: any = {};
428
+ if (message.amountRaw !== "") {
429
+ obj.amountRaw = message.amountRaw;
430
+ }
431
+ if (message.amountFormatted !== "") {
432
+ obj.amountFormatted = message.amountFormatted;
433
+ }
434
+ return obj;
435
+ },
436
+
437
+ create<I extends Exact<DeepPartial<NativeValue>, I>>(base?: I): NativeValue {
438
+ return NativeValue.fromPartial(base ?? ({} as any));
439
+ },
440
+ fromPartial<I extends Exact<DeepPartial<NativeValue>, I>>(object: I): NativeValue {
441
+ const message = createBaseNativeValue();
442
+ message.amountRaw = object.amountRaw ?? "";
443
+ message.amountFormatted = object.amountFormatted ?? "";
444
+ return message;
445
+ },
446
+ };
447
+
448
+ function createBaseStreamBridgeMatchesRequest(): StreamBridgeMatchesRequest {
449
+ return {};
450
+ }
451
+
452
+ export const StreamBridgeMatchesRequest: MessageFns<StreamBridgeMatchesRequest> = {
453
+ encode(_: StreamBridgeMatchesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
454
+ return writer;
455
+ },
456
+
457
+ decode(input: BinaryReader | Uint8Array, length?: number): StreamBridgeMatchesRequest {
458
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
459
+ const end = length === undefined ? reader.len : reader.pos + length;
460
+ const message = createBaseStreamBridgeMatchesRequest();
461
+ while (reader.pos < end) {
462
+ const tag = reader.uint32();
463
+ switch (tag >>> 3) {
464
+ }
465
+ if ((tag & 7) === 4 || tag === 0) {
466
+ break;
467
+ }
468
+ reader.skip(tag & 7);
469
+ }
470
+ return message;
471
+ },
472
+
473
+ fromJSON(_: any): StreamBridgeMatchesRequest {
474
+ return {};
475
+ },
476
+
477
+ toJSON(_: StreamBridgeMatchesRequest): unknown {
478
+ const obj: any = {};
479
+ return obj;
480
+ },
481
+
482
+ create<I extends Exact<DeepPartial<StreamBridgeMatchesRequest>, I>>(base?: I): StreamBridgeMatchesRequest {
483
+ return StreamBridgeMatchesRequest.fromPartial(base ?? ({} as any));
484
+ },
485
+ fromPartial<I extends Exact<DeepPartial<StreamBridgeMatchesRequest>, I>>(_: I): StreamBridgeMatchesRequest {
486
+ const message = createBaseStreamBridgeMatchesRequest();
487
+ return message;
488
+ },
489
+ };
490
+
491
+ function createBaseBridgeMatchEnvelope(): BridgeMatchEnvelope {
492
+ return { snapshot: undefined, update: undefined };
493
+ }
494
+
495
+ export const BridgeMatchEnvelope: MessageFns<BridgeMatchEnvelope> = {
496
+ encode(message: BridgeMatchEnvelope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
497
+ if (message.snapshot !== undefined) {
498
+ BridgeMatchSnapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
499
+ }
500
+ if (message.update !== undefined) {
501
+ BridgeMatchUpdate.encode(message.update, writer.uint32(18).fork()).join();
502
+ }
503
+ return writer;
504
+ },
505
+
506
+ decode(input: BinaryReader | Uint8Array, length?: number): BridgeMatchEnvelope {
507
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
508
+ const end = length === undefined ? reader.len : reader.pos + length;
509
+ const message = createBaseBridgeMatchEnvelope();
510
+ while (reader.pos < end) {
511
+ const tag = reader.uint32();
512
+ switch (tag >>> 3) {
513
+ case 1: {
514
+ if (tag !== 10) {
515
+ break;
516
+ }
517
+
518
+ message.snapshot = BridgeMatchSnapshot.decode(reader, reader.uint32());
519
+ continue;
520
+ }
521
+ case 2: {
522
+ if (tag !== 18) {
523
+ break;
524
+ }
525
+
526
+ message.update = BridgeMatchUpdate.decode(reader, reader.uint32());
527
+ continue;
528
+ }
529
+ }
530
+ if ((tag & 7) === 4 || tag === 0) {
531
+ break;
532
+ }
533
+ reader.skip(tag & 7);
534
+ }
535
+ return message;
536
+ },
537
+
538
+ fromJSON(object: any): BridgeMatchEnvelope {
539
+ return {
540
+ snapshot: isSet(object.snapshot) ? BridgeMatchSnapshot.fromJSON(object.snapshot) : undefined,
541
+ update: isSet(object.update) ? BridgeMatchUpdate.fromJSON(object.update) : undefined,
542
+ };
543
+ },
544
+
545
+ toJSON(message: BridgeMatchEnvelope): unknown {
546
+ const obj: any = {};
547
+ if (message.snapshot !== undefined) {
548
+ obj.snapshot = BridgeMatchSnapshot.toJSON(message.snapshot);
549
+ }
550
+ if (message.update !== undefined) {
551
+ obj.update = BridgeMatchUpdate.toJSON(message.update);
552
+ }
553
+ return obj;
554
+ },
555
+
556
+ create<I extends Exact<DeepPartial<BridgeMatchEnvelope>, I>>(base?: I): BridgeMatchEnvelope {
557
+ return BridgeMatchEnvelope.fromPartial(base ?? ({} as any));
558
+ },
559
+ fromPartial<I extends Exact<DeepPartial<BridgeMatchEnvelope>, I>>(object: I): BridgeMatchEnvelope {
560
+ const message = createBaseBridgeMatchEnvelope();
561
+ message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
562
+ ? BridgeMatchSnapshot.fromPartial(object.snapshot)
563
+ : undefined;
564
+ message.update = (object.update !== undefined && object.update !== null)
565
+ ? BridgeMatchUpdate.fromPartial(object.update)
566
+ : undefined;
567
+ return message;
568
+ },
569
+ };
570
+
571
+ function createBaseBridgeMatchSnapshot(): BridgeMatchSnapshot {
572
+ return { items: [] };
573
+ }
574
+
575
+ export const BridgeMatchSnapshot: MessageFns<BridgeMatchSnapshot> = {
576
+ encode(message: BridgeMatchSnapshot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
577
+ for (const v of message.items) {
578
+ BridgeMatchItem.encode(v!, writer.uint32(10).fork()).join();
579
+ }
580
+ return writer;
581
+ },
582
+
583
+ decode(input: BinaryReader | Uint8Array, length?: number): BridgeMatchSnapshot {
584
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
585
+ const end = length === undefined ? reader.len : reader.pos + length;
586
+ const message = createBaseBridgeMatchSnapshot();
587
+ while (reader.pos < end) {
588
+ const tag = reader.uint32();
589
+ switch (tag >>> 3) {
590
+ case 1: {
591
+ if (tag !== 10) {
592
+ break;
593
+ }
594
+
595
+ message.items.push(BridgeMatchItem.decode(reader, reader.uint32()));
596
+ continue;
597
+ }
598
+ }
599
+ if ((tag & 7) === 4 || tag === 0) {
600
+ break;
601
+ }
602
+ reader.skip(tag & 7);
603
+ }
604
+ return message;
605
+ },
606
+
607
+ fromJSON(object: any): BridgeMatchSnapshot {
608
+ return {
609
+ items: globalThis.Array.isArray(object?.items) ? object.items.map((e: any) => BridgeMatchItem.fromJSON(e)) : [],
610
+ };
611
+ },
612
+
613
+ toJSON(message: BridgeMatchSnapshot): unknown {
614
+ const obj: any = {};
615
+ if (message.items?.length) {
616
+ obj.items = message.items.map((e) => BridgeMatchItem.toJSON(e));
617
+ }
618
+ return obj;
619
+ },
620
+
621
+ create<I extends Exact<DeepPartial<BridgeMatchSnapshot>, I>>(base?: I): BridgeMatchSnapshot {
622
+ return BridgeMatchSnapshot.fromPartial(base ?? ({} as any));
623
+ },
624
+ fromPartial<I extends Exact<DeepPartial<BridgeMatchSnapshot>, I>>(object: I): BridgeMatchSnapshot {
625
+ const message = createBaseBridgeMatchSnapshot();
626
+ message.items = object.items?.map((e) => BridgeMatchItem.fromPartial(e)) || [];
627
+ return message;
628
+ },
629
+ };
630
+
631
+ function createBaseBridgeMatchUpdate(): BridgeMatchUpdate {
632
+ return { item: undefined };
633
+ }
634
+
635
+ export const BridgeMatchUpdate: MessageFns<BridgeMatchUpdate> = {
636
+ encode(message: BridgeMatchUpdate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
637
+ if (message.item !== undefined) {
638
+ BridgeMatchItem.encode(message.item, writer.uint32(10).fork()).join();
639
+ }
640
+ return writer;
641
+ },
642
+
643
+ decode(input: BinaryReader | Uint8Array, length?: number): BridgeMatchUpdate {
644
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
645
+ const end = length === undefined ? reader.len : reader.pos + length;
646
+ const message = createBaseBridgeMatchUpdate();
647
+ while (reader.pos < end) {
648
+ const tag = reader.uint32();
649
+ switch (tag >>> 3) {
650
+ case 1: {
651
+ if (tag !== 10) {
652
+ break;
653
+ }
654
+
655
+ message.item = BridgeMatchItem.decode(reader, reader.uint32());
656
+ continue;
657
+ }
658
+ }
659
+ if ((tag & 7) === 4 || tag === 0) {
660
+ break;
661
+ }
662
+ reader.skip(tag & 7);
663
+ }
664
+ return message;
665
+ },
666
+
667
+ fromJSON(object: any): BridgeMatchUpdate {
668
+ return { item: isSet(object.item) ? BridgeMatchItem.fromJSON(object.item) : undefined };
669
+ },
670
+
671
+ toJSON(message: BridgeMatchUpdate): unknown {
672
+ const obj: any = {};
673
+ if (message.item !== undefined) {
674
+ obj.item = BridgeMatchItem.toJSON(message.item);
675
+ }
676
+ return obj;
677
+ },
678
+
679
+ create<I extends Exact<DeepPartial<BridgeMatchUpdate>, I>>(base?: I): BridgeMatchUpdate {
680
+ return BridgeMatchUpdate.fromPartial(base ?? ({} as any));
681
+ },
682
+ fromPartial<I extends Exact<DeepPartial<BridgeMatchUpdate>, I>>(object: I): BridgeMatchUpdate {
683
+ const message = createBaseBridgeMatchUpdate();
684
+ message.item = (object.item !== undefined && object.item !== null)
685
+ ? BridgeMatchItem.fromPartial(object.item)
686
+ : undefined;
687
+ return message;
688
+ },
689
+ };
690
+
691
+ function createBaseBridgeMatchItem(): BridgeMatchItem {
692
+ return {
693
+ correlationId: "",
694
+ sourceTxHash: "",
695
+ sourceChainDetails: undefined,
696
+ destinationTxHash: "",
697
+ destinationChainDetails: undefined,
698
+ bridgeName: "",
699
+ timestamp: undefined,
700
+ sourceBridgeDescription: "",
701
+ destinationBridgeDescription: "",
702
+ metadata: {},
703
+ token: undefined,
704
+ native: undefined,
705
+ };
706
+ }
707
+
708
+ export const BridgeMatchItem: MessageFns<BridgeMatchItem> = {
709
+ encode(message: BridgeMatchItem, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
710
+ if (message.correlationId !== "") {
711
+ writer.uint32(10).string(message.correlationId);
712
+ }
713
+ if (message.sourceTxHash !== "") {
714
+ writer.uint32(18).string(message.sourceTxHash);
715
+ }
716
+ if (message.sourceChainDetails !== undefined) {
717
+ ChainDetails.encode(message.sourceChainDetails, writer.uint32(26).fork()).join();
718
+ }
719
+ if (message.destinationTxHash !== "") {
720
+ writer.uint32(34).string(message.destinationTxHash);
721
+ }
722
+ if (message.destinationChainDetails !== undefined) {
723
+ ChainDetails.encode(message.destinationChainDetails, writer.uint32(42).fork()).join();
724
+ }
725
+ if (message.bridgeName !== "") {
726
+ writer.uint32(50).string(message.bridgeName);
727
+ }
728
+ if (message.timestamp !== undefined) {
729
+ Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(58).fork()).join();
730
+ }
731
+ if (message.sourceBridgeDescription !== "") {
732
+ writer.uint32(66).string(message.sourceBridgeDescription);
733
+ }
734
+ if (message.destinationBridgeDescription !== "") {
735
+ writer.uint32(74).string(message.destinationBridgeDescription);
736
+ }
737
+ globalThis.Object.entries(message.metadata).forEach(([key, value]: [string, string]) => {
738
+ BridgeMatchItem_MetadataEntry.encode({ key: key as any, value }, writer.uint32(82).fork()).join();
739
+ });
740
+ if (message.token !== undefined) {
741
+ TokenValue.encode(message.token, writer.uint32(90).fork()).join();
742
+ }
743
+ if (message.native !== undefined) {
744
+ NativeValue.encode(message.native, writer.uint32(98).fork()).join();
745
+ }
746
+ return writer;
747
+ },
748
+
749
+ decode(input: BinaryReader | Uint8Array, length?: number): BridgeMatchItem {
750
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
751
+ const end = length === undefined ? reader.len : reader.pos + length;
752
+ const message = createBaseBridgeMatchItem();
753
+ while (reader.pos < end) {
754
+ const tag = reader.uint32();
755
+ switch (tag >>> 3) {
756
+ case 1: {
757
+ if (tag !== 10) {
758
+ break;
759
+ }
760
+
761
+ message.correlationId = reader.string();
762
+ continue;
763
+ }
764
+ case 2: {
765
+ if (tag !== 18) {
766
+ break;
767
+ }
768
+
769
+ message.sourceTxHash = reader.string();
770
+ continue;
771
+ }
772
+ case 3: {
773
+ if (tag !== 26) {
774
+ break;
775
+ }
776
+
777
+ message.sourceChainDetails = ChainDetails.decode(reader, reader.uint32());
778
+ continue;
779
+ }
780
+ case 4: {
781
+ if (tag !== 34) {
782
+ break;
783
+ }
784
+
785
+ message.destinationTxHash = reader.string();
786
+ continue;
787
+ }
788
+ case 5: {
789
+ if (tag !== 42) {
790
+ break;
791
+ }
792
+
793
+ message.destinationChainDetails = ChainDetails.decode(reader, reader.uint32());
794
+ continue;
795
+ }
796
+ case 6: {
797
+ if (tag !== 50) {
798
+ break;
799
+ }
800
+
801
+ message.bridgeName = reader.string();
802
+ continue;
803
+ }
804
+ case 7: {
805
+ if (tag !== 58) {
806
+ break;
807
+ }
808
+
809
+ message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
810
+ continue;
811
+ }
812
+ case 8: {
813
+ if (tag !== 66) {
814
+ break;
815
+ }
816
+
817
+ message.sourceBridgeDescription = reader.string();
818
+ continue;
819
+ }
820
+ case 9: {
821
+ if (tag !== 74) {
822
+ break;
823
+ }
824
+
825
+ message.destinationBridgeDescription = reader.string();
826
+ continue;
827
+ }
828
+ case 10: {
829
+ if (tag !== 82) {
830
+ break;
831
+ }
832
+
833
+ const entry10 = BridgeMatchItem_MetadataEntry.decode(reader, reader.uint32());
834
+ if (entry10.value !== undefined) {
835
+ message.metadata[entry10.key] = entry10.value;
836
+ }
837
+ continue;
838
+ }
839
+ case 11: {
840
+ if (tag !== 90) {
841
+ break;
842
+ }
843
+
844
+ message.token = TokenValue.decode(reader, reader.uint32());
845
+ continue;
846
+ }
847
+ case 12: {
848
+ if (tag !== 98) {
849
+ break;
850
+ }
851
+
852
+ message.native = NativeValue.decode(reader, reader.uint32());
853
+ continue;
854
+ }
855
+ }
856
+ if ((tag & 7) === 4 || tag === 0) {
857
+ break;
858
+ }
859
+ reader.skip(tag & 7);
860
+ }
861
+ return message;
862
+ },
863
+
864
+ fromJSON(object: any): BridgeMatchItem {
865
+ return {
866
+ correlationId: isSet(object.correlationId)
867
+ ? globalThis.String(object.correlationId)
868
+ : isSet(object.correlation_id)
869
+ ? globalThis.String(object.correlation_id)
870
+ : "",
871
+ sourceTxHash: isSet(object.sourceTxHash)
872
+ ? globalThis.String(object.sourceTxHash)
873
+ : isSet(object.source_tx_hash)
874
+ ? globalThis.String(object.source_tx_hash)
875
+ : "",
876
+ sourceChainDetails: isSet(object.sourceChainDetails)
877
+ ? ChainDetails.fromJSON(object.sourceChainDetails)
878
+ : isSet(object.source_chain_details)
879
+ ? ChainDetails.fromJSON(object.source_chain_details)
880
+ : undefined,
881
+ destinationTxHash: isSet(object.destinationTxHash)
882
+ ? globalThis.String(object.destinationTxHash)
883
+ : isSet(object.destination_tx_hash)
884
+ ? globalThis.String(object.destination_tx_hash)
885
+ : "",
886
+ destinationChainDetails: isSet(object.destinationChainDetails)
887
+ ? ChainDetails.fromJSON(object.destinationChainDetails)
888
+ : isSet(object.destination_chain_details)
889
+ ? ChainDetails.fromJSON(object.destination_chain_details)
890
+ : undefined,
891
+ bridgeName: isSet(object.bridgeName)
892
+ ? globalThis.String(object.bridgeName)
893
+ : isSet(object.bridge_name)
894
+ ? globalThis.String(object.bridge_name)
895
+ : "",
896
+ timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
897
+ sourceBridgeDescription: isSet(object.sourceBridgeDescription)
898
+ ? globalThis.String(object.sourceBridgeDescription)
899
+ : isSet(object.source_bridge_description)
900
+ ? globalThis.String(object.source_bridge_description)
901
+ : "",
902
+ destinationBridgeDescription: isSet(object.destinationBridgeDescription)
903
+ ? globalThis.String(object.destinationBridgeDescription)
904
+ : isSet(object.destination_bridge_description)
905
+ ? globalThis.String(object.destination_bridge_description)
906
+ : "",
907
+ metadata: isObject(object.metadata)
908
+ ? (globalThis.Object.entries(object.metadata) as [string, any][]).reduce(
909
+ (acc: { [key: string]: string }, [key, value]: [string, any]) => {
910
+ acc[key] = globalThis.String(value);
911
+ return acc;
912
+ },
913
+ {},
914
+ )
915
+ : {},
916
+ token: isSet(object.token) ? TokenValue.fromJSON(object.token) : undefined,
917
+ native: isSet(object.native) ? NativeValue.fromJSON(object.native) : undefined,
918
+ };
919
+ },
920
+
921
+ toJSON(message: BridgeMatchItem): unknown {
922
+ const obj: any = {};
923
+ if (message.correlationId !== "") {
924
+ obj.correlationId = message.correlationId;
925
+ }
926
+ if (message.sourceTxHash !== "") {
927
+ obj.sourceTxHash = message.sourceTxHash;
928
+ }
929
+ if (message.sourceChainDetails !== undefined) {
930
+ obj.sourceChainDetails = ChainDetails.toJSON(message.sourceChainDetails);
931
+ }
932
+ if (message.destinationTxHash !== "") {
933
+ obj.destinationTxHash = message.destinationTxHash;
934
+ }
935
+ if (message.destinationChainDetails !== undefined) {
936
+ obj.destinationChainDetails = ChainDetails.toJSON(message.destinationChainDetails);
937
+ }
938
+ if (message.bridgeName !== "") {
939
+ obj.bridgeName = message.bridgeName;
940
+ }
941
+ if (message.timestamp !== undefined) {
942
+ obj.timestamp = message.timestamp.toISOString();
943
+ }
944
+ if (message.sourceBridgeDescription !== "") {
945
+ obj.sourceBridgeDescription = message.sourceBridgeDescription;
946
+ }
947
+ if (message.destinationBridgeDescription !== "") {
948
+ obj.destinationBridgeDescription = message.destinationBridgeDescription;
949
+ }
950
+ if (message.metadata) {
951
+ const entries = globalThis.Object.entries(message.metadata) as [string, string][];
952
+ if (entries.length > 0) {
953
+ obj.metadata = {};
954
+ entries.forEach(([k, v]) => {
955
+ obj.metadata[k] = v;
956
+ });
957
+ }
958
+ }
959
+ if (message.token !== undefined) {
960
+ obj.token = TokenValue.toJSON(message.token);
961
+ }
962
+ if (message.native !== undefined) {
963
+ obj.native = NativeValue.toJSON(message.native);
964
+ }
965
+ return obj;
966
+ },
967
+
968
+ create<I extends Exact<DeepPartial<BridgeMatchItem>, I>>(base?: I): BridgeMatchItem {
969
+ return BridgeMatchItem.fromPartial(base ?? ({} as any));
970
+ },
971
+ fromPartial<I extends Exact<DeepPartial<BridgeMatchItem>, I>>(object: I): BridgeMatchItem {
972
+ const message = createBaseBridgeMatchItem();
973
+ message.correlationId = object.correlationId ?? "";
974
+ message.sourceTxHash = object.sourceTxHash ?? "";
975
+ message.sourceChainDetails = (object.sourceChainDetails !== undefined && object.sourceChainDetails !== null)
976
+ ? ChainDetails.fromPartial(object.sourceChainDetails)
977
+ : undefined;
978
+ message.destinationTxHash = object.destinationTxHash ?? "";
979
+ message.destinationChainDetails =
980
+ (object.destinationChainDetails !== undefined && object.destinationChainDetails !== null)
981
+ ? ChainDetails.fromPartial(object.destinationChainDetails)
982
+ : undefined;
983
+ message.bridgeName = object.bridgeName ?? "";
984
+ message.timestamp = object.timestamp ?? undefined;
985
+ message.sourceBridgeDescription = object.sourceBridgeDescription ?? "";
986
+ message.destinationBridgeDescription = object.destinationBridgeDescription ?? "";
987
+ message.metadata = (globalThis.Object.entries(object.metadata ?? {}) as [string, string][]).reduce(
988
+ (acc: { [key: string]: string }, [key, value]: [string, string]) => {
989
+ if (value !== undefined) {
990
+ acc[key] = globalThis.String(value);
991
+ }
992
+ return acc;
993
+ },
994
+ {},
995
+ );
996
+ message.token = (object.token !== undefined && object.token !== null)
997
+ ? TokenValue.fromPartial(object.token)
998
+ : undefined;
999
+ message.native = (object.native !== undefined && object.native !== null)
1000
+ ? NativeValue.fromPartial(object.native)
1001
+ : undefined;
1002
+ return message;
1003
+ },
1004
+ };
1005
+
1006
+ function createBaseBridgeMatchItem_MetadataEntry(): BridgeMatchItem_MetadataEntry {
1007
+ return { key: "", value: "" };
1008
+ }
1009
+
1010
+ export const BridgeMatchItem_MetadataEntry: MessageFns<BridgeMatchItem_MetadataEntry> = {
1011
+ encode(message: BridgeMatchItem_MetadataEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1012
+ if (message.key !== "") {
1013
+ writer.uint32(10).string(message.key);
1014
+ }
1015
+ if (message.value !== "") {
1016
+ writer.uint32(18).string(message.value);
1017
+ }
1018
+ return writer;
1019
+ },
1020
+
1021
+ decode(input: BinaryReader | Uint8Array, length?: number): BridgeMatchItem_MetadataEntry {
1022
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1023
+ const end = length === undefined ? reader.len : reader.pos + length;
1024
+ const message = createBaseBridgeMatchItem_MetadataEntry();
1025
+ while (reader.pos < end) {
1026
+ const tag = reader.uint32();
1027
+ switch (tag >>> 3) {
1028
+ case 1: {
1029
+ if (tag !== 10) {
1030
+ break;
1031
+ }
1032
+
1033
+ message.key = reader.string();
1034
+ continue;
1035
+ }
1036
+ case 2: {
1037
+ if (tag !== 18) {
1038
+ break;
1039
+ }
1040
+
1041
+ message.value = reader.string();
1042
+ continue;
1043
+ }
1044
+ }
1045
+ if ((tag & 7) === 4 || tag === 0) {
1046
+ break;
1047
+ }
1048
+ reader.skip(tag & 7);
1049
+ }
1050
+ return message;
1051
+ },
1052
+
1053
+ fromJSON(object: any): BridgeMatchItem_MetadataEntry {
1054
+ return {
1055
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
1056
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
1057
+ };
1058
+ },
1059
+
1060
+ toJSON(message: BridgeMatchItem_MetadataEntry): unknown {
1061
+ const obj: any = {};
1062
+ if (message.key !== "") {
1063
+ obj.key = message.key;
1064
+ }
1065
+ if (message.value !== "") {
1066
+ obj.value = message.value;
1067
+ }
1068
+ return obj;
1069
+ },
1070
+
1071
+ create<I extends Exact<DeepPartial<BridgeMatchItem_MetadataEntry>, I>>(base?: I): BridgeMatchItem_MetadataEntry {
1072
+ return BridgeMatchItem_MetadataEntry.fromPartial(base ?? ({} as any));
1073
+ },
1074
+ fromPartial<I extends Exact<DeepPartial<BridgeMatchItem_MetadataEntry>, I>>(
1075
+ object: I,
1076
+ ): BridgeMatchItem_MetadataEntry {
1077
+ const message = createBaseBridgeMatchItem_MetadataEntry();
1078
+ message.key = object.key ?? "";
1079
+ message.value = object.value ?? "";
1080
+ return message;
1081
+ },
1082
+ };
1083
+
1084
+ function createBaseStreamEvmBlocksRequest(): StreamEvmBlocksRequest {
1085
+ return { evmChainId: 0, includeSnapshot: false };
1086
+ }
1087
+
1088
+ export const StreamEvmBlocksRequest: MessageFns<StreamEvmBlocksRequest> = {
1089
+ encode(message: StreamEvmBlocksRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1090
+ if (message.evmChainId !== 0) {
1091
+ writer.uint32(8).uint64(message.evmChainId);
1092
+ }
1093
+ if (message.includeSnapshot !== false) {
1094
+ writer.uint32(16).bool(message.includeSnapshot);
1095
+ }
1096
+ return writer;
1097
+ },
1098
+
1099
+ decode(input: BinaryReader | Uint8Array, length?: number): StreamEvmBlocksRequest {
1100
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1101
+ const end = length === undefined ? reader.len : reader.pos + length;
1102
+ const message = createBaseStreamEvmBlocksRequest();
1103
+ while (reader.pos < end) {
1104
+ const tag = reader.uint32();
1105
+ switch (tag >>> 3) {
1106
+ case 1: {
1107
+ if (tag !== 8) {
1108
+ break;
1109
+ }
1110
+
1111
+ message.evmChainId = longToNumber(reader.uint64());
1112
+ continue;
1113
+ }
1114
+ case 2: {
1115
+ if (tag !== 16) {
1116
+ break;
1117
+ }
1118
+
1119
+ message.includeSnapshot = reader.bool();
1120
+ continue;
1121
+ }
1122
+ }
1123
+ if ((tag & 7) === 4 || tag === 0) {
1124
+ break;
1125
+ }
1126
+ reader.skip(tag & 7);
1127
+ }
1128
+ return message;
1129
+ },
1130
+
1131
+ fromJSON(object: any): StreamEvmBlocksRequest {
1132
+ return {
1133
+ evmChainId: isSet(object.evmChainId)
1134
+ ? globalThis.Number(object.evmChainId)
1135
+ : isSet(object.evm_chain_id)
1136
+ ? globalThis.Number(object.evm_chain_id)
1137
+ : 0,
1138
+ includeSnapshot: isSet(object.includeSnapshot)
1139
+ ? globalThis.Boolean(object.includeSnapshot)
1140
+ : isSet(object.include_snapshot)
1141
+ ? globalThis.Boolean(object.include_snapshot)
1142
+ : false,
1143
+ };
1144
+ },
1145
+
1146
+ toJSON(message: StreamEvmBlocksRequest): unknown {
1147
+ const obj: any = {};
1148
+ if (message.evmChainId !== 0) {
1149
+ obj.evmChainId = Math.round(message.evmChainId);
1150
+ }
1151
+ if (message.includeSnapshot !== false) {
1152
+ obj.includeSnapshot = message.includeSnapshot;
1153
+ }
1154
+ return obj;
1155
+ },
1156
+
1157
+ create<I extends Exact<DeepPartial<StreamEvmBlocksRequest>, I>>(base?: I): StreamEvmBlocksRequest {
1158
+ return StreamEvmBlocksRequest.fromPartial(base ?? ({} as any));
1159
+ },
1160
+ fromPartial<I extends Exact<DeepPartial<StreamEvmBlocksRequest>, I>>(object: I): StreamEvmBlocksRequest {
1161
+ const message = createBaseStreamEvmBlocksRequest();
1162
+ message.evmChainId = object.evmChainId ?? 0;
1163
+ message.includeSnapshot = object.includeSnapshot ?? false;
1164
+ return message;
1165
+ },
1166
+ };
1167
+
1168
+ function createBaseEvmBlockStreamItem(): EvmBlockStreamItem {
1169
+ return {
1170
+ chainDetails: undefined,
1171
+ blockNumber: 0,
1172
+ blockHash: "",
1173
+ blockTimestamp: undefined,
1174
+ parentHash: "",
1175
+ createdAt: undefined,
1176
+ };
1177
+ }
1178
+
1179
+ export const EvmBlockStreamItem: MessageFns<EvmBlockStreamItem> = {
1180
+ encode(message: EvmBlockStreamItem, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1181
+ if (message.chainDetails !== undefined) {
1182
+ ChainDetails.encode(message.chainDetails, writer.uint32(10).fork()).join();
1183
+ }
1184
+ if (message.blockNumber !== 0) {
1185
+ writer.uint32(16).uint64(message.blockNumber);
1186
+ }
1187
+ if (message.blockHash !== "") {
1188
+ writer.uint32(26).string(message.blockHash);
1189
+ }
1190
+ if (message.blockTimestamp !== undefined) {
1191
+ Timestamp.encode(toTimestamp(message.blockTimestamp), writer.uint32(34).fork()).join();
1192
+ }
1193
+ if (message.parentHash !== "") {
1194
+ writer.uint32(42).string(message.parentHash);
1195
+ }
1196
+ if (message.createdAt !== undefined) {
1197
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(50).fork()).join();
1198
+ }
1199
+ return writer;
1200
+ },
1201
+
1202
+ decode(input: BinaryReader | Uint8Array, length?: number): EvmBlockStreamItem {
1203
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1204
+ const end = length === undefined ? reader.len : reader.pos + length;
1205
+ const message = createBaseEvmBlockStreamItem();
1206
+ while (reader.pos < end) {
1207
+ const tag = reader.uint32();
1208
+ switch (tag >>> 3) {
1209
+ case 1: {
1210
+ if (tag !== 10) {
1211
+ break;
1212
+ }
1213
+
1214
+ message.chainDetails = ChainDetails.decode(reader, reader.uint32());
1215
+ continue;
1216
+ }
1217
+ case 2: {
1218
+ if (tag !== 16) {
1219
+ break;
1220
+ }
1221
+
1222
+ message.blockNumber = longToNumber(reader.uint64());
1223
+ continue;
1224
+ }
1225
+ case 3: {
1226
+ if (tag !== 26) {
1227
+ break;
1228
+ }
1229
+
1230
+ message.blockHash = reader.string();
1231
+ continue;
1232
+ }
1233
+ case 4: {
1234
+ if (tag !== 34) {
1235
+ break;
1236
+ }
1237
+
1238
+ message.blockTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1239
+ continue;
1240
+ }
1241
+ case 5: {
1242
+ if (tag !== 42) {
1243
+ break;
1244
+ }
1245
+
1246
+ message.parentHash = reader.string();
1247
+ continue;
1248
+ }
1249
+ case 6: {
1250
+ if (tag !== 50) {
1251
+ break;
1252
+ }
1253
+
1254
+ message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1255
+ continue;
1256
+ }
1257
+ }
1258
+ if ((tag & 7) === 4 || tag === 0) {
1259
+ break;
1260
+ }
1261
+ reader.skip(tag & 7);
1262
+ }
1263
+ return message;
1264
+ },
1265
+
1266
+ fromJSON(object: any): EvmBlockStreamItem {
1267
+ return {
1268
+ chainDetails: isSet(object.chainDetails)
1269
+ ? ChainDetails.fromJSON(object.chainDetails)
1270
+ : isSet(object.chain_details)
1271
+ ? ChainDetails.fromJSON(object.chain_details)
1272
+ : undefined,
1273
+ blockNumber: isSet(object.blockNumber)
1274
+ ? globalThis.Number(object.blockNumber)
1275
+ : isSet(object.block_number)
1276
+ ? globalThis.Number(object.block_number)
1277
+ : 0,
1278
+ blockHash: isSet(object.blockHash)
1279
+ ? globalThis.String(object.blockHash)
1280
+ : isSet(object.block_hash)
1281
+ ? globalThis.String(object.block_hash)
1282
+ : "",
1283
+ blockTimestamp: isSet(object.blockTimestamp)
1284
+ ? fromJsonTimestamp(object.blockTimestamp)
1285
+ : isSet(object.block_timestamp)
1286
+ ? fromJsonTimestamp(object.block_timestamp)
1287
+ : undefined,
1288
+ parentHash: isSet(object.parentHash)
1289
+ ? globalThis.String(object.parentHash)
1290
+ : isSet(object.parent_hash)
1291
+ ? globalThis.String(object.parent_hash)
1292
+ : "",
1293
+ createdAt: isSet(object.createdAt)
1294
+ ? fromJsonTimestamp(object.createdAt)
1295
+ : isSet(object.created_at)
1296
+ ? fromJsonTimestamp(object.created_at)
1297
+ : undefined,
1298
+ };
1299
+ },
1300
+
1301
+ toJSON(message: EvmBlockStreamItem): unknown {
1302
+ const obj: any = {};
1303
+ if (message.chainDetails !== undefined) {
1304
+ obj.chainDetails = ChainDetails.toJSON(message.chainDetails);
1305
+ }
1306
+ if (message.blockNumber !== 0) {
1307
+ obj.blockNumber = Math.round(message.blockNumber);
1308
+ }
1309
+ if (message.blockHash !== "") {
1310
+ obj.blockHash = message.blockHash;
1311
+ }
1312
+ if (message.blockTimestamp !== undefined) {
1313
+ obj.blockTimestamp = message.blockTimestamp.toISOString();
1314
+ }
1315
+ if (message.parentHash !== "") {
1316
+ obj.parentHash = message.parentHash;
1317
+ }
1318
+ if (message.createdAt !== undefined) {
1319
+ obj.createdAt = message.createdAt.toISOString();
1320
+ }
1321
+ return obj;
1322
+ },
1323
+
1324
+ create<I extends Exact<DeepPartial<EvmBlockStreamItem>, I>>(base?: I): EvmBlockStreamItem {
1325
+ return EvmBlockStreamItem.fromPartial(base ?? ({} as any));
1326
+ },
1327
+ fromPartial<I extends Exact<DeepPartial<EvmBlockStreamItem>, I>>(object: I): EvmBlockStreamItem {
1328
+ const message = createBaseEvmBlockStreamItem();
1329
+ message.chainDetails = (object.chainDetails !== undefined && object.chainDetails !== null)
1330
+ ? ChainDetails.fromPartial(object.chainDetails)
1331
+ : undefined;
1332
+ message.blockNumber = object.blockNumber ?? 0;
1333
+ message.blockHash = object.blockHash ?? "";
1334
+ message.blockTimestamp = object.blockTimestamp ?? undefined;
1335
+ message.parentHash = object.parentHash ?? "";
1336
+ message.createdAt = object.createdAt ?? undefined;
1337
+ return message;
1338
+ },
1339
+ };
1340
+
1341
+ function createBaseStreamSafeMultisigTransactionsRequest(): StreamSafeMultisigTransactionsRequest {
1342
+ return {};
1343
+ }
1344
+
1345
+ export const StreamSafeMultisigTransactionsRequest: MessageFns<StreamSafeMultisigTransactionsRequest> = {
1346
+ encode(_: StreamSafeMultisigTransactionsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1347
+ return writer;
1348
+ },
1349
+
1350
+ decode(input: BinaryReader | Uint8Array, length?: number): StreamSafeMultisigTransactionsRequest {
1351
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1352
+ const end = length === undefined ? reader.len : reader.pos + length;
1353
+ const message = createBaseStreamSafeMultisigTransactionsRequest();
1354
+ while (reader.pos < end) {
1355
+ const tag = reader.uint32();
1356
+ switch (tag >>> 3) {
1357
+ }
1358
+ if ((tag & 7) === 4 || tag === 0) {
1359
+ break;
1360
+ }
1361
+ reader.skip(tag & 7);
1362
+ }
1363
+ return message;
1364
+ },
1365
+
1366
+ fromJSON(_: any): StreamSafeMultisigTransactionsRequest {
1367
+ return {};
1368
+ },
1369
+
1370
+ toJSON(_: StreamSafeMultisigTransactionsRequest): unknown {
1371
+ const obj: any = {};
1372
+ return obj;
1373
+ },
1374
+
1375
+ create<I extends Exact<DeepPartial<StreamSafeMultisigTransactionsRequest>, I>>(
1376
+ base?: I,
1377
+ ): StreamSafeMultisigTransactionsRequest {
1378
+ return StreamSafeMultisigTransactionsRequest.fromPartial(base ?? ({} as any));
1379
+ },
1380
+ fromPartial<I extends Exact<DeepPartial<StreamSafeMultisigTransactionsRequest>, I>>(
1381
+ _: I,
1382
+ ): StreamSafeMultisigTransactionsRequest {
1383
+ const message = createBaseStreamSafeMultisigTransactionsRequest();
1384
+ return message;
1385
+ },
1386
+ };
1387
+
1388
+ function createBaseSafeMultisigTransactionEnvelope(): SafeMultisigTransactionEnvelope {
1389
+ return { snapshot: undefined, update: undefined };
1390
+ }
1391
+
1392
+ export const SafeMultisigTransactionEnvelope: MessageFns<SafeMultisigTransactionEnvelope> = {
1393
+ encode(message: SafeMultisigTransactionEnvelope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1394
+ if (message.snapshot !== undefined) {
1395
+ SafeMultisigTransactionSnapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
1396
+ }
1397
+ if (message.update !== undefined) {
1398
+ SafeMultisigTransactionUpdate.encode(message.update, writer.uint32(18).fork()).join();
1399
+ }
1400
+ return writer;
1401
+ },
1402
+
1403
+ decode(input: BinaryReader | Uint8Array, length?: number): SafeMultisigTransactionEnvelope {
1404
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1405
+ const end = length === undefined ? reader.len : reader.pos + length;
1406
+ const message = createBaseSafeMultisigTransactionEnvelope();
1407
+ while (reader.pos < end) {
1408
+ const tag = reader.uint32();
1409
+ switch (tag >>> 3) {
1410
+ case 1: {
1411
+ if (tag !== 10) {
1412
+ break;
1413
+ }
1414
+
1415
+ message.snapshot = SafeMultisigTransactionSnapshot.decode(reader, reader.uint32());
1416
+ continue;
1417
+ }
1418
+ case 2: {
1419
+ if (tag !== 18) {
1420
+ break;
1421
+ }
1422
+
1423
+ message.update = SafeMultisigTransactionUpdate.decode(reader, reader.uint32());
1424
+ continue;
1425
+ }
1426
+ }
1427
+ if ((tag & 7) === 4 || tag === 0) {
1428
+ break;
1429
+ }
1430
+ reader.skip(tag & 7);
1431
+ }
1432
+ return message;
1433
+ },
1434
+
1435
+ fromJSON(object: any): SafeMultisigTransactionEnvelope {
1436
+ return {
1437
+ snapshot: isSet(object.snapshot) ? SafeMultisigTransactionSnapshot.fromJSON(object.snapshot) : undefined,
1438
+ update: isSet(object.update) ? SafeMultisigTransactionUpdate.fromJSON(object.update) : undefined,
1439
+ };
1440
+ },
1441
+
1442
+ toJSON(message: SafeMultisigTransactionEnvelope): unknown {
1443
+ const obj: any = {};
1444
+ if (message.snapshot !== undefined) {
1445
+ obj.snapshot = SafeMultisigTransactionSnapshot.toJSON(message.snapshot);
1446
+ }
1447
+ if (message.update !== undefined) {
1448
+ obj.update = SafeMultisigTransactionUpdate.toJSON(message.update);
1449
+ }
1450
+ return obj;
1451
+ },
1452
+
1453
+ create<I extends Exact<DeepPartial<SafeMultisigTransactionEnvelope>, I>>(base?: I): SafeMultisigTransactionEnvelope {
1454
+ return SafeMultisigTransactionEnvelope.fromPartial(base ?? ({} as any));
1455
+ },
1456
+ fromPartial<I extends Exact<DeepPartial<SafeMultisigTransactionEnvelope>, I>>(
1457
+ object: I,
1458
+ ): SafeMultisigTransactionEnvelope {
1459
+ const message = createBaseSafeMultisigTransactionEnvelope();
1460
+ message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
1461
+ ? SafeMultisigTransactionSnapshot.fromPartial(object.snapshot)
1462
+ : undefined;
1463
+ message.update = (object.update !== undefined && object.update !== null)
1464
+ ? SafeMultisigTransactionUpdate.fromPartial(object.update)
1465
+ : undefined;
1466
+ return message;
1467
+ },
1468
+ };
1469
+
1470
+ function createBaseSafeMultisigTransactionSnapshot(): SafeMultisigTransactionSnapshot {
1471
+ return { items: [] };
1472
+ }
1473
+
1474
+ export const SafeMultisigTransactionSnapshot: MessageFns<SafeMultisigTransactionSnapshot> = {
1475
+ encode(message: SafeMultisigTransactionSnapshot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1476
+ for (const v of message.items) {
1477
+ SafeMultisigTransactionItem.encode(v!, writer.uint32(10).fork()).join();
1478
+ }
1479
+ return writer;
1480
+ },
1481
+
1482
+ decode(input: BinaryReader | Uint8Array, length?: number): SafeMultisigTransactionSnapshot {
1483
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1484
+ const end = length === undefined ? reader.len : reader.pos + length;
1485
+ const message = createBaseSafeMultisigTransactionSnapshot();
1486
+ while (reader.pos < end) {
1487
+ const tag = reader.uint32();
1488
+ switch (tag >>> 3) {
1489
+ case 1: {
1490
+ if (tag !== 10) {
1491
+ break;
1492
+ }
1493
+
1494
+ message.items.push(SafeMultisigTransactionItem.decode(reader, reader.uint32()));
1495
+ continue;
1496
+ }
1497
+ }
1498
+ if ((tag & 7) === 4 || tag === 0) {
1499
+ break;
1500
+ }
1501
+ reader.skip(tag & 7);
1502
+ }
1503
+ return message;
1504
+ },
1505
+
1506
+ fromJSON(object: any): SafeMultisigTransactionSnapshot {
1507
+ return {
1508
+ items: globalThis.Array.isArray(object?.items)
1509
+ ? object.items.map((e: any) => SafeMultisigTransactionItem.fromJSON(e))
1510
+ : [],
1511
+ };
1512
+ },
1513
+
1514
+ toJSON(message: SafeMultisigTransactionSnapshot): unknown {
1515
+ const obj: any = {};
1516
+ if (message.items?.length) {
1517
+ obj.items = message.items.map((e) => SafeMultisigTransactionItem.toJSON(e));
1518
+ }
1519
+ return obj;
1520
+ },
1521
+
1522
+ create<I extends Exact<DeepPartial<SafeMultisigTransactionSnapshot>, I>>(base?: I): SafeMultisigTransactionSnapshot {
1523
+ return SafeMultisigTransactionSnapshot.fromPartial(base ?? ({} as any));
1524
+ },
1525
+ fromPartial<I extends Exact<DeepPartial<SafeMultisigTransactionSnapshot>, I>>(
1526
+ object: I,
1527
+ ): SafeMultisigTransactionSnapshot {
1528
+ const message = createBaseSafeMultisigTransactionSnapshot();
1529
+ message.items = object.items?.map((e) => SafeMultisigTransactionItem.fromPartial(e)) || [];
1530
+ return message;
1531
+ },
1532
+ };
1533
+
1534
+ function createBaseSafeMultisigTransactionUpdate(): SafeMultisigTransactionUpdate {
1535
+ return { item: undefined };
1536
+ }
1537
+
1538
+ export const SafeMultisigTransactionUpdate: MessageFns<SafeMultisigTransactionUpdate> = {
1539
+ encode(message: SafeMultisigTransactionUpdate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1540
+ if (message.item !== undefined) {
1541
+ SafeMultisigTransactionItem.encode(message.item, writer.uint32(10).fork()).join();
1542
+ }
1543
+ return writer;
1544
+ },
1545
+
1546
+ decode(input: BinaryReader | Uint8Array, length?: number): SafeMultisigTransactionUpdate {
1547
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1548
+ const end = length === undefined ? reader.len : reader.pos + length;
1549
+ const message = createBaseSafeMultisigTransactionUpdate();
1550
+ while (reader.pos < end) {
1551
+ const tag = reader.uint32();
1552
+ switch (tag >>> 3) {
1553
+ case 1: {
1554
+ if (tag !== 10) {
1555
+ break;
1556
+ }
1557
+
1558
+ message.item = SafeMultisigTransactionItem.decode(reader, reader.uint32());
1559
+ continue;
1560
+ }
1561
+ }
1562
+ if ((tag & 7) === 4 || tag === 0) {
1563
+ break;
1564
+ }
1565
+ reader.skip(tag & 7);
1566
+ }
1567
+ return message;
1568
+ },
1569
+
1570
+ fromJSON(object: any): SafeMultisigTransactionUpdate {
1571
+ return { item: isSet(object.item) ? SafeMultisigTransactionItem.fromJSON(object.item) : undefined };
1572
+ },
1573
+
1574
+ toJSON(message: SafeMultisigTransactionUpdate): unknown {
1575
+ const obj: any = {};
1576
+ if (message.item !== undefined) {
1577
+ obj.item = SafeMultisigTransactionItem.toJSON(message.item);
1578
+ }
1579
+ return obj;
1580
+ },
1581
+
1582
+ create<I extends Exact<DeepPartial<SafeMultisigTransactionUpdate>, I>>(base?: I): SafeMultisigTransactionUpdate {
1583
+ return SafeMultisigTransactionUpdate.fromPartial(base ?? ({} as any));
1584
+ },
1585
+ fromPartial<I extends Exact<DeepPartial<SafeMultisigTransactionUpdate>, I>>(
1586
+ object: I,
1587
+ ): SafeMultisigTransactionUpdate {
1588
+ const message = createBaseSafeMultisigTransactionUpdate();
1589
+ message.item = (object.item !== undefined && object.item !== null)
1590
+ ? SafeMultisigTransactionItem.fromPartial(object.item)
1591
+ : undefined;
1592
+ return message;
1593
+ },
1594
+ };
1595
+
1596
+ function createBaseSafeMultisigTransactionItem(): SafeMultisigTransactionItem {
1597
+ return {
1598
+ safeAddress: "",
1599
+ chainDetails: undefined,
1600
+ eventType: 0,
1601
+ safeTxHash: "",
1602
+ publishedAt: undefined,
1603
+ rawPayload: new Uint8Array(0),
1604
+ };
1605
+ }
1606
+
1607
+ export const SafeMultisigTransactionItem: MessageFns<SafeMultisigTransactionItem> = {
1608
+ encode(message: SafeMultisigTransactionItem, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1609
+ if (message.safeAddress !== "") {
1610
+ writer.uint32(10).string(message.safeAddress);
1611
+ }
1612
+ if (message.chainDetails !== undefined) {
1613
+ ChainDetails.encode(message.chainDetails, writer.uint32(18).fork()).join();
1614
+ }
1615
+ if (message.eventType !== 0) {
1616
+ writer.uint32(24).int32(message.eventType);
1617
+ }
1618
+ if (message.safeTxHash !== "") {
1619
+ writer.uint32(34).string(message.safeTxHash);
1620
+ }
1621
+ if (message.publishedAt !== undefined) {
1622
+ Timestamp.encode(toTimestamp(message.publishedAt), writer.uint32(42).fork()).join();
1623
+ }
1624
+ if (message.rawPayload.length !== 0) {
1625
+ writer.uint32(50).bytes(message.rawPayload);
1626
+ }
1627
+ return writer;
1628
+ },
1629
+
1630
+ decode(input: BinaryReader | Uint8Array, length?: number): SafeMultisigTransactionItem {
1631
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1632
+ const end = length === undefined ? reader.len : reader.pos + length;
1633
+ const message = createBaseSafeMultisigTransactionItem();
1634
+ while (reader.pos < end) {
1635
+ const tag = reader.uint32();
1636
+ switch (tag >>> 3) {
1637
+ case 1: {
1638
+ if (tag !== 10) {
1639
+ break;
1640
+ }
1641
+
1642
+ message.safeAddress = reader.string();
1643
+ continue;
1644
+ }
1645
+ case 2: {
1646
+ if (tag !== 18) {
1647
+ break;
1648
+ }
1649
+
1650
+ message.chainDetails = ChainDetails.decode(reader, reader.uint32());
1651
+ continue;
1652
+ }
1653
+ case 3: {
1654
+ if (tag !== 24) {
1655
+ break;
1656
+ }
1657
+
1658
+ message.eventType = reader.int32() as any;
1659
+ continue;
1660
+ }
1661
+ case 4: {
1662
+ if (tag !== 34) {
1663
+ break;
1664
+ }
1665
+
1666
+ message.safeTxHash = reader.string();
1667
+ continue;
1668
+ }
1669
+ case 5: {
1670
+ if (tag !== 42) {
1671
+ break;
1672
+ }
1673
+
1674
+ message.publishedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1675
+ continue;
1676
+ }
1677
+ case 6: {
1678
+ if (tag !== 50) {
1679
+ break;
1680
+ }
1681
+
1682
+ message.rawPayload = reader.bytes();
1683
+ continue;
1684
+ }
1685
+ }
1686
+ if ((tag & 7) === 4 || tag === 0) {
1687
+ break;
1688
+ }
1689
+ reader.skip(tag & 7);
1690
+ }
1691
+ return message;
1692
+ },
1693
+
1694
+ fromJSON(object: any): SafeMultisigTransactionItem {
1695
+ return {
1696
+ safeAddress: isSet(object.safeAddress)
1697
+ ? globalThis.String(object.safeAddress)
1698
+ : isSet(object.safe_address)
1699
+ ? globalThis.String(object.safe_address)
1700
+ : "",
1701
+ chainDetails: isSet(object.chainDetails)
1702
+ ? ChainDetails.fromJSON(object.chainDetails)
1703
+ : isSet(object.chain_details)
1704
+ ? ChainDetails.fromJSON(object.chain_details)
1705
+ : undefined,
1706
+ eventType: isSet(object.eventType)
1707
+ ? safeTransactionEventTypeFromJSON(object.eventType)
1708
+ : isSet(object.event_type)
1709
+ ? safeTransactionEventTypeFromJSON(object.event_type)
1710
+ : 0,
1711
+ safeTxHash: isSet(object.safeTxHash)
1712
+ ? globalThis.String(object.safeTxHash)
1713
+ : isSet(object.safe_tx_hash)
1714
+ ? globalThis.String(object.safe_tx_hash)
1715
+ : "",
1716
+ publishedAt: isSet(object.publishedAt)
1717
+ ? fromJsonTimestamp(object.publishedAt)
1718
+ : isSet(object.published_at)
1719
+ ? fromJsonTimestamp(object.published_at)
1720
+ : undefined,
1721
+ rawPayload: isSet(object.rawPayload)
1722
+ ? bytesFromBase64(object.rawPayload)
1723
+ : isSet(object.raw_payload)
1724
+ ? bytesFromBase64(object.raw_payload)
1725
+ : new Uint8Array(0),
1726
+ };
1727
+ },
1728
+
1729
+ toJSON(message: SafeMultisigTransactionItem): unknown {
1730
+ const obj: any = {};
1731
+ if (message.safeAddress !== "") {
1732
+ obj.safeAddress = message.safeAddress;
1733
+ }
1734
+ if (message.chainDetails !== undefined) {
1735
+ obj.chainDetails = ChainDetails.toJSON(message.chainDetails);
1736
+ }
1737
+ if (message.eventType !== 0) {
1738
+ obj.eventType = safeTransactionEventTypeToJSON(message.eventType);
1739
+ }
1740
+ if (message.safeTxHash !== "") {
1741
+ obj.safeTxHash = message.safeTxHash;
1742
+ }
1743
+ if (message.publishedAt !== undefined) {
1744
+ obj.publishedAt = message.publishedAt.toISOString();
1745
+ }
1746
+ if (message.rawPayload.length !== 0) {
1747
+ obj.rawPayload = base64FromBytes(message.rawPayload);
1748
+ }
1749
+ return obj;
1750
+ },
1751
+
1752
+ create<I extends Exact<DeepPartial<SafeMultisigTransactionItem>, I>>(base?: I): SafeMultisigTransactionItem {
1753
+ return SafeMultisigTransactionItem.fromPartial(base ?? ({} as any));
1754
+ },
1755
+ fromPartial<I extends Exact<DeepPartial<SafeMultisigTransactionItem>, I>>(object: I): SafeMultisigTransactionItem {
1756
+ const message = createBaseSafeMultisigTransactionItem();
1757
+ message.safeAddress = object.safeAddress ?? "";
1758
+ message.chainDetails = (object.chainDetails !== undefined && object.chainDetails !== null)
1759
+ ? ChainDetails.fromPartial(object.chainDetails)
1760
+ : undefined;
1761
+ message.eventType = object.eventType ?? 0;
1762
+ message.safeTxHash = object.safeTxHash ?? "";
1763
+ message.publishedAt = object.publishedAt ?? undefined;
1764
+ message.rawPayload = object.rawPayload ?? new Uint8Array(0);
1765
+ return message;
1766
+ },
1767
+ };
1768
+
1769
+ function createBaseStreamSafeMultisigMessagesRequest(): StreamSafeMultisigMessagesRequest {
1770
+ return {};
1771
+ }
1772
+
1773
+ export const StreamSafeMultisigMessagesRequest: MessageFns<StreamSafeMultisigMessagesRequest> = {
1774
+ encode(_: StreamSafeMultisigMessagesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1775
+ return writer;
1776
+ },
1777
+
1778
+ decode(input: BinaryReader | Uint8Array, length?: number): StreamSafeMultisigMessagesRequest {
1779
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1780
+ const end = length === undefined ? reader.len : reader.pos + length;
1781
+ const message = createBaseStreamSafeMultisigMessagesRequest();
1782
+ while (reader.pos < end) {
1783
+ const tag = reader.uint32();
1784
+ switch (tag >>> 3) {
1785
+ }
1786
+ if ((tag & 7) === 4 || tag === 0) {
1787
+ break;
1788
+ }
1789
+ reader.skip(tag & 7);
1790
+ }
1791
+ return message;
1792
+ },
1793
+
1794
+ fromJSON(_: any): StreamSafeMultisigMessagesRequest {
1795
+ return {};
1796
+ },
1797
+
1798
+ toJSON(_: StreamSafeMultisigMessagesRequest): unknown {
1799
+ const obj: any = {};
1800
+ return obj;
1801
+ },
1802
+
1803
+ create<I extends Exact<DeepPartial<StreamSafeMultisigMessagesRequest>, I>>(
1804
+ base?: I,
1805
+ ): StreamSafeMultisigMessagesRequest {
1806
+ return StreamSafeMultisigMessagesRequest.fromPartial(base ?? ({} as any));
1807
+ },
1808
+ fromPartial<I extends Exact<DeepPartial<StreamSafeMultisigMessagesRequest>, I>>(
1809
+ _: I,
1810
+ ): StreamSafeMultisigMessagesRequest {
1811
+ const message = createBaseStreamSafeMultisigMessagesRequest();
1812
+ return message;
1813
+ },
1814
+ };
1815
+
1816
+ function createBaseSafeMultisigMessageEnvelope(): SafeMultisigMessageEnvelope {
1817
+ return { snapshot: undefined, update: undefined };
1818
+ }
1819
+
1820
+ export const SafeMultisigMessageEnvelope: MessageFns<SafeMultisigMessageEnvelope> = {
1821
+ encode(message: SafeMultisigMessageEnvelope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1822
+ if (message.snapshot !== undefined) {
1823
+ SafeMultisigMessageSnapshot.encode(message.snapshot, writer.uint32(10).fork()).join();
1824
+ }
1825
+ if (message.update !== undefined) {
1826
+ SafeMultisigMessageUpdate.encode(message.update, writer.uint32(18).fork()).join();
1827
+ }
1828
+ return writer;
1829
+ },
1830
+
1831
+ decode(input: BinaryReader | Uint8Array, length?: number): SafeMultisigMessageEnvelope {
1832
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1833
+ const end = length === undefined ? reader.len : reader.pos + length;
1834
+ const message = createBaseSafeMultisigMessageEnvelope();
1835
+ while (reader.pos < end) {
1836
+ const tag = reader.uint32();
1837
+ switch (tag >>> 3) {
1838
+ case 1: {
1839
+ if (tag !== 10) {
1840
+ break;
1841
+ }
1842
+
1843
+ message.snapshot = SafeMultisigMessageSnapshot.decode(reader, reader.uint32());
1844
+ continue;
1845
+ }
1846
+ case 2: {
1847
+ if (tag !== 18) {
1848
+ break;
1849
+ }
1850
+
1851
+ message.update = SafeMultisigMessageUpdate.decode(reader, reader.uint32());
1852
+ continue;
1853
+ }
1854
+ }
1855
+ if ((tag & 7) === 4 || tag === 0) {
1856
+ break;
1857
+ }
1858
+ reader.skip(tag & 7);
1859
+ }
1860
+ return message;
1861
+ },
1862
+
1863
+ fromJSON(object: any): SafeMultisigMessageEnvelope {
1864
+ return {
1865
+ snapshot: isSet(object.snapshot) ? SafeMultisigMessageSnapshot.fromJSON(object.snapshot) : undefined,
1866
+ update: isSet(object.update) ? SafeMultisigMessageUpdate.fromJSON(object.update) : undefined,
1867
+ };
1868
+ },
1869
+
1870
+ toJSON(message: SafeMultisigMessageEnvelope): unknown {
1871
+ const obj: any = {};
1872
+ if (message.snapshot !== undefined) {
1873
+ obj.snapshot = SafeMultisigMessageSnapshot.toJSON(message.snapshot);
1874
+ }
1875
+ if (message.update !== undefined) {
1876
+ obj.update = SafeMultisigMessageUpdate.toJSON(message.update);
1877
+ }
1878
+ return obj;
1879
+ },
1880
+
1881
+ create<I extends Exact<DeepPartial<SafeMultisigMessageEnvelope>, I>>(base?: I): SafeMultisigMessageEnvelope {
1882
+ return SafeMultisigMessageEnvelope.fromPartial(base ?? ({} as any));
1883
+ },
1884
+ fromPartial<I extends Exact<DeepPartial<SafeMultisigMessageEnvelope>, I>>(object: I): SafeMultisigMessageEnvelope {
1885
+ const message = createBaseSafeMultisigMessageEnvelope();
1886
+ message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
1887
+ ? SafeMultisigMessageSnapshot.fromPartial(object.snapshot)
1888
+ : undefined;
1889
+ message.update = (object.update !== undefined && object.update !== null)
1890
+ ? SafeMultisigMessageUpdate.fromPartial(object.update)
1891
+ : undefined;
1892
+ return message;
1893
+ },
1894
+ };
1895
+
1896
+ function createBaseSafeMultisigMessageSnapshot(): SafeMultisigMessageSnapshot {
1897
+ return { items: [] };
1898
+ }
1899
+
1900
+ export const SafeMultisigMessageSnapshot: MessageFns<SafeMultisigMessageSnapshot> = {
1901
+ encode(message: SafeMultisigMessageSnapshot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1902
+ for (const v of message.items) {
1903
+ SafeMultisigMessageItem.encode(v!, writer.uint32(10).fork()).join();
1904
+ }
1905
+ return writer;
1906
+ },
1907
+
1908
+ decode(input: BinaryReader | Uint8Array, length?: number): SafeMultisigMessageSnapshot {
1909
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1910
+ const end = length === undefined ? reader.len : reader.pos + length;
1911
+ const message = createBaseSafeMultisigMessageSnapshot();
1912
+ while (reader.pos < end) {
1913
+ const tag = reader.uint32();
1914
+ switch (tag >>> 3) {
1915
+ case 1: {
1916
+ if (tag !== 10) {
1917
+ break;
1918
+ }
1919
+
1920
+ message.items.push(SafeMultisigMessageItem.decode(reader, reader.uint32()));
1921
+ continue;
1922
+ }
1923
+ }
1924
+ if ((tag & 7) === 4 || tag === 0) {
1925
+ break;
1926
+ }
1927
+ reader.skip(tag & 7);
1928
+ }
1929
+ return message;
1930
+ },
1931
+
1932
+ fromJSON(object: any): SafeMultisigMessageSnapshot {
1933
+ return {
1934
+ items: globalThis.Array.isArray(object?.items)
1935
+ ? object.items.map((e: any) => SafeMultisigMessageItem.fromJSON(e))
1936
+ : [],
1937
+ };
1938
+ },
1939
+
1940
+ toJSON(message: SafeMultisigMessageSnapshot): unknown {
1941
+ const obj: any = {};
1942
+ if (message.items?.length) {
1943
+ obj.items = message.items.map((e) => SafeMultisigMessageItem.toJSON(e));
1944
+ }
1945
+ return obj;
1946
+ },
1947
+
1948
+ create<I extends Exact<DeepPartial<SafeMultisigMessageSnapshot>, I>>(base?: I): SafeMultisigMessageSnapshot {
1949
+ return SafeMultisigMessageSnapshot.fromPartial(base ?? ({} as any));
1950
+ },
1951
+ fromPartial<I extends Exact<DeepPartial<SafeMultisigMessageSnapshot>, I>>(object: I): SafeMultisigMessageSnapshot {
1952
+ const message = createBaseSafeMultisigMessageSnapshot();
1953
+ message.items = object.items?.map((e) => SafeMultisigMessageItem.fromPartial(e)) || [];
1954
+ return message;
1955
+ },
1956
+ };
1957
+
1958
+ function createBaseSafeMultisigMessageUpdate(): SafeMultisigMessageUpdate {
1959
+ return { item: undefined };
1960
+ }
1961
+
1962
+ export const SafeMultisigMessageUpdate: MessageFns<SafeMultisigMessageUpdate> = {
1963
+ encode(message: SafeMultisigMessageUpdate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1964
+ if (message.item !== undefined) {
1965
+ SafeMultisigMessageItem.encode(message.item, writer.uint32(10).fork()).join();
1966
+ }
1967
+ return writer;
1968
+ },
1969
+
1970
+ decode(input: BinaryReader | Uint8Array, length?: number): SafeMultisigMessageUpdate {
1971
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1972
+ const end = length === undefined ? reader.len : reader.pos + length;
1973
+ const message = createBaseSafeMultisigMessageUpdate();
1974
+ while (reader.pos < end) {
1975
+ const tag = reader.uint32();
1976
+ switch (tag >>> 3) {
1977
+ case 1: {
1978
+ if (tag !== 10) {
1979
+ break;
1980
+ }
1981
+
1982
+ message.item = SafeMultisigMessageItem.decode(reader, reader.uint32());
1983
+ continue;
1984
+ }
1985
+ }
1986
+ if ((tag & 7) === 4 || tag === 0) {
1987
+ break;
1988
+ }
1989
+ reader.skip(tag & 7);
1990
+ }
1991
+ return message;
1992
+ },
1993
+
1994
+ fromJSON(object: any): SafeMultisigMessageUpdate {
1995
+ return { item: isSet(object.item) ? SafeMultisigMessageItem.fromJSON(object.item) : undefined };
1996
+ },
1997
+
1998
+ toJSON(message: SafeMultisigMessageUpdate): unknown {
1999
+ const obj: any = {};
2000
+ if (message.item !== undefined) {
2001
+ obj.item = SafeMultisigMessageItem.toJSON(message.item);
2002
+ }
2003
+ return obj;
2004
+ },
2005
+
2006
+ create<I extends Exact<DeepPartial<SafeMultisigMessageUpdate>, I>>(base?: I): SafeMultisigMessageUpdate {
2007
+ return SafeMultisigMessageUpdate.fromPartial(base ?? ({} as any));
2008
+ },
2009
+ fromPartial<I extends Exact<DeepPartial<SafeMultisigMessageUpdate>, I>>(object: I): SafeMultisigMessageUpdate {
2010
+ const message = createBaseSafeMultisigMessageUpdate();
2011
+ message.item = (object.item !== undefined && object.item !== null)
2012
+ ? SafeMultisigMessageItem.fromPartial(object.item)
2013
+ : undefined;
2014
+ return message;
2015
+ },
2016
+ };
2017
+
2018
+ function createBaseSafeMultisigMessageItem(): SafeMultisigMessageItem {
2019
+ return {
2020
+ safeAddress: "",
2021
+ chainDetails: undefined,
2022
+ eventType: 0,
2023
+ messageHash: "",
2024
+ publishedAt: undefined,
2025
+ rawPayload: new Uint8Array(0),
2026
+ };
2027
+ }
2028
+
2029
+ export const SafeMultisigMessageItem: MessageFns<SafeMultisigMessageItem> = {
2030
+ encode(message: SafeMultisigMessageItem, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
2031
+ if (message.safeAddress !== "") {
2032
+ writer.uint32(10).string(message.safeAddress);
2033
+ }
2034
+ if (message.chainDetails !== undefined) {
2035
+ ChainDetails.encode(message.chainDetails, writer.uint32(18).fork()).join();
2036
+ }
2037
+ if (message.eventType !== 0) {
2038
+ writer.uint32(24).int32(message.eventType);
2039
+ }
2040
+ if (message.messageHash !== "") {
2041
+ writer.uint32(34).string(message.messageHash);
2042
+ }
2043
+ if (message.publishedAt !== undefined) {
2044
+ Timestamp.encode(toTimestamp(message.publishedAt), writer.uint32(42).fork()).join();
2045
+ }
2046
+ if (message.rawPayload.length !== 0) {
2047
+ writer.uint32(50).bytes(message.rawPayload);
2048
+ }
2049
+ return writer;
2050
+ },
2051
+
2052
+ decode(input: BinaryReader | Uint8Array, length?: number): SafeMultisigMessageItem {
2053
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2054
+ const end = length === undefined ? reader.len : reader.pos + length;
2055
+ const message = createBaseSafeMultisigMessageItem();
2056
+ while (reader.pos < end) {
2057
+ const tag = reader.uint32();
2058
+ switch (tag >>> 3) {
2059
+ case 1: {
2060
+ if (tag !== 10) {
2061
+ break;
2062
+ }
2063
+
2064
+ message.safeAddress = reader.string();
2065
+ continue;
2066
+ }
2067
+ case 2: {
2068
+ if (tag !== 18) {
2069
+ break;
2070
+ }
2071
+
2072
+ message.chainDetails = ChainDetails.decode(reader, reader.uint32());
2073
+ continue;
2074
+ }
2075
+ case 3: {
2076
+ if (tag !== 24) {
2077
+ break;
2078
+ }
2079
+
2080
+ message.eventType = reader.int32() as any;
2081
+ continue;
2082
+ }
2083
+ case 4: {
2084
+ if (tag !== 34) {
2085
+ break;
2086
+ }
2087
+
2088
+ message.messageHash = reader.string();
2089
+ continue;
2090
+ }
2091
+ case 5: {
2092
+ if (tag !== 42) {
2093
+ break;
2094
+ }
2095
+
2096
+ message.publishedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2097
+ continue;
2098
+ }
2099
+ case 6: {
2100
+ if (tag !== 50) {
2101
+ break;
2102
+ }
2103
+
2104
+ message.rawPayload = reader.bytes();
2105
+ continue;
2106
+ }
2107
+ }
2108
+ if ((tag & 7) === 4 || tag === 0) {
2109
+ break;
2110
+ }
2111
+ reader.skip(tag & 7);
2112
+ }
2113
+ return message;
2114
+ },
2115
+
2116
+ fromJSON(object: any): SafeMultisigMessageItem {
2117
+ return {
2118
+ safeAddress: isSet(object.safeAddress)
2119
+ ? globalThis.String(object.safeAddress)
2120
+ : isSet(object.safe_address)
2121
+ ? globalThis.String(object.safe_address)
2122
+ : "",
2123
+ chainDetails: isSet(object.chainDetails)
2124
+ ? ChainDetails.fromJSON(object.chainDetails)
2125
+ : isSet(object.chain_details)
2126
+ ? ChainDetails.fromJSON(object.chain_details)
2127
+ : undefined,
2128
+ eventType: isSet(object.eventType)
2129
+ ? safeMessageEventTypeFromJSON(object.eventType)
2130
+ : isSet(object.event_type)
2131
+ ? safeMessageEventTypeFromJSON(object.event_type)
2132
+ : 0,
2133
+ messageHash: isSet(object.messageHash)
2134
+ ? globalThis.String(object.messageHash)
2135
+ : isSet(object.message_hash)
2136
+ ? globalThis.String(object.message_hash)
2137
+ : "",
2138
+ publishedAt: isSet(object.publishedAt)
2139
+ ? fromJsonTimestamp(object.publishedAt)
2140
+ : isSet(object.published_at)
2141
+ ? fromJsonTimestamp(object.published_at)
2142
+ : undefined,
2143
+ rawPayload: isSet(object.rawPayload)
2144
+ ? bytesFromBase64(object.rawPayload)
2145
+ : isSet(object.raw_payload)
2146
+ ? bytesFromBase64(object.raw_payload)
2147
+ : new Uint8Array(0),
2148
+ };
2149
+ },
2150
+
2151
+ toJSON(message: SafeMultisigMessageItem): unknown {
2152
+ const obj: any = {};
2153
+ if (message.safeAddress !== "") {
2154
+ obj.safeAddress = message.safeAddress;
2155
+ }
2156
+ if (message.chainDetails !== undefined) {
2157
+ obj.chainDetails = ChainDetails.toJSON(message.chainDetails);
2158
+ }
2159
+ if (message.eventType !== 0) {
2160
+ obj.eventType = safeMessageEventTypeToJSON(message.eventType);
2161
+ }
2162
+ if (message.messageHash !== "") {
2163
+ obj.messageHash = message.messageHash;
2164
+ }
2165
+ if (message.publishedAt !== undefined) {
2166
+ obj.publishedAt = message.publishedAt.toISOString();
2167
+ }
2168
+ if (message.rawPayload.length !== 0) {
2169
+ obj.rawPayload = base64FromBytes(message.rawPayload);
2170
+ }
2171
+ return obj;
2172
+ },
2173
+
2174
+ create<I extends Exact<DeepPartial<SafeMultisigMessageItem>, I>>(base?: I): SafeMultisigMessageItem {
2175
+ return SafeMultisigMessageItem.fromPartial(base ?? ({} as any));
2176
+ },
2177
+ fromPartial<I extends Exact<DeepPartial<SafeMultisigMessageItem>, I>>(object: I): SafeMultisigMessageItem {
2178
+ const message = createBaseSafeMultisigMessageItem();
2179
+ message.safeAddress = object.safeAddress ?? "";
2180
+ message.chainDetails = (object.chainDetails !== undefined && object.chainDetails !== null)
2181
+ ? ChainDetails.fromPartial(object.chainDetails)
2182
+ : undefined;
2183
+ message.eventType = object.eventType ?? 0;
2184
+ message.messageHash = object.messageHash ?? "";
2185
+ message.publishedAt = object.publishedAt ?? undefined;
2186
+ message.rawPayload = object.rawPayload ?? new Uint8Array(0);
2187
+ return message;
2188
+ },
2189
+ };
2190
+
2191
+ export interface StreamGatewayService {
2192
+ StreamBridgeMatches(request: StreamBridgeMatchesRequest, metadata?: Metadata): Observable<BridgeMatchEnvelope>;
2193
+ StreamEvmBlocks(request: StreamEvmBlocksRequest, metadata?: Metadata): Observable<EvmBlockStreamItem>;
2194
+ StreamSafeMultisigTransactions(
2195
+ request: StreamSafeMultisigTransactionsRequest,
2196
+ metadata?: Metadata,
2197
+ ): Observable<SafeMultisigTransactionEnvelope>;
2198
+ StreamSafeMultisigMessages(
2199
+ request: StreamSafeMultisigMessagesRequest,
2200
+ metadata?: Metadata,
2201
+ ): Observable<SafeMultisigMessageEnvelope>;
2202
+ }
2203
+
2204
+ export const StreamGatewayServiceServiceName = "gateway.web.v1.StreamGatewayService";
2205
+ export class StreamGatewayServiceClientImpl implements StreamGatewayService {
2206
+ private readonly rpc: Rpc;
2207
+ private readonly service: string;
2208
+ constructor(rpc: Rpc, opts?: { service?: string }) {
2209
+ this.service = opts?.service || StreamGatewayServiceServiceName;
2210
+ this.rpc = rpc;
2211
+ this.StreamBridgeMatches = this.StreamBridgeMatches.bind(this);
2212
+ this.StreamEvmBlocks = this.StreamEvmBlocks.bind(this);
2213
+ this.StreamSafeMultisigTransactions = this.StreamSafeMultisigTransactions.bind(this);
2214
+ this.StreamSafeMultisigMessages = this.StreamSafeMultisigMessages.bind(this);
2215
+ }
2216
+ StreamBridgeMatches(request: StreamBridgeMatchesRequest, metadata?: Metadata): Observable<BridgeMatchEnvelope> {
2217
+ const data = StreamBridgeMatchesRequest.encode(request).finish();
2218
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamBridgeMatches", data, metadata);
2219
+ return result.pipe(map((data) => BridgeMatchEnvelope.decode(new BinaryReader(data))));
2220
+ }
2221
+
2222
+ StreamEvmBlocks(request: StreamEvmBlocksRequest, metadata?: Metadata): Observable<EvmBlockStreamItem> {
2223
+ const data = StreamEvmBlocksRequest.encode(request).finish();
2224
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamEvmBlocks", data, metadata);
2225
+ return result.pipe(map((data) => EvmBlockStreamItem.decode(new BinaryReader(data))));
2226
+ }
2227
+
2228
+ StreamSafeMultisigTransactions(
2229
+ request: StreamSafeMultisigTransactionsRequest,
2230
+ metadata?: Metadata,
2231
+ ): Observable<SafeMultisigTransactionEnvelope> {
2232
+ const data = StreamSafeMultisigTransactionsRequest.encode(request).finish();
2233
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamSafeMultisigTransactions", data, metadata);
2234
+ return result.pipe(map((data) => SafeMultisigTransactionEnvelope.decode(new BinaryReader(data))));
2235
+ }
2236
+
2237
+ StreamSafeMultisigMessages(
2238
+ request: StreamSafeMultisigMessagesRequest,
2239
+ metadata?: Metadata,
2240
+ ): Observable<SafeMultisigMessageEnvelope> {
2241
+ const data = StreamSafeMultisigMessagesRequest.encode(request).finish();
2242
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamSafeMultisigMessages", data, metadata);
2243
+ return result.pipe(map((data) => SafeMultisigMessageEnvelope.decode(new BinaryReader(data))));
2244
+ }
2245
+ }
2246
+
2247
+ interface Rpc {
2248
+ request(service: string, method: string, data: Uint8Array, metadata?: Metadata): Promise<Uint8Array>;
2249
+ clientStreamingRequest(
2250
+ service: string,
2251
+ method: string,
2252
+ data: Observable<Uint8Array>,
2253
+ metadata?: Metadata,
2254
+ ): Promise<Uint8Array>;
2255
+ serverStreamingRequest(
2256
+ service: string,
2257
+ method: string,
2258
+ data: Uint8Array,
2259
+ metadata?: Metadata,
2260
+ ): Observable<Uint8Array>;
2261
+ bidirectionalStreamingRequest(
2262
+ service: string,
2263
+ method: string,
2264
+ data: Observable<Uint8Array>,
2265
+ metadata?: Metadata,
2266
+ ): Observable<Uint8Array>;
2267
+ }
2268
+
2269
+ function bytesFromBase64(b64: string): Uint8Array {
2270
+ if ((globalThis as any).Buffer) {
2271
+ return Uint8Array.from((globalThis as any).Buffer.from(b64, "base64"));
2272
+ } else {
2273
+ const bin = globalThis.atob(b64);
2274
+ const arr = new Uint8Array(bin.length);
2275
+ for (let i = 0; i < bin.length; ++i) {
2276
+ arr[i] = bin.charCodeAt(i);
2277
+ }
2278
+ return arr;
2279
+ }
2280
+ }
2281
+
2282
+ function base64FromBytes(arr: Uint8Array): string {
2283
+ if ((globalThis as any).Buffer) {
2284
+ return (globalThis as any).Buffer.from(arr).toString("base64");
2285
+ } else {
2286
+ const bin: string[] = [];
2287
+ arr.forEach((byte) => {
2288
+ bin.push(globalThis.String.fromCharCode(byte));
2289
+ });
2290
+ return globalThis.btoa(bin.join(""));
2291
+ }
2292
+ }
2293
+
2294
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
2295
+
2296
+ export type DeepPartial<T> = T extends Builtin ? T
2297
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
2298
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
2299
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
2300
+ : Partial<T>;
2301
+
2302
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
2303
+ export type Exact<P, I extends P> = P extends Builtin ? P
2304
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
2305
+
2306
+ function toTimestamp(date: Date): Timestamp {
2307
+ const seconds = Math.trunc(date.getTime() / 1_000);
2308
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
2309
+ return { seconds, nanos };
2310
+ }
2311
+
2312
+ function fromTimestamp(t: Timestamp): Date {
2313
+ let millis = (t.seconds || 0) * 1_000;
2314
+ millis += (t.nanos || 0) / 1_000_000;
2315
+ return new globalThis.Date(millis);
2316
+ }
2317
+
2318
+ function fromJsonTimestamp(o: any): Date {
2319
+ if (o instanceof globalThis.Date) {
2320
+ return o;
2321
+ } else if (typeof o === "string") {
2322
+ return new globalThis.Date(o);
2323
+ } else {
2324
+ return fromTimestamp(Timestamp.fromJSON(o));
2325
+ }
2326
+ }
2327
+
2328
+ function longToNumber(int64: { toString(): string }): number {
2329
+ const num = globalThis.Number(int64.toString());
2330
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
2331
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
2332
+ }
2333
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
2334
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
2335
+ }
2336
+ return num;
2337
+ }
2338
+
2339
+ function isObject(value: any): boolean {
2340
+ return typeof value === "object" && value !== null;
2341
+ }
2342
+
2343
+ function isSet(value: any): boolean {
2344
+ return value !== null && value !== undefined;
2345
+ }
2346
+
2347
+ export interface MessageFns<T> {
2348
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
2349
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
2350
+ fromJSON(object: any): T;
2351
+ toJSON(message: T): unknown;
2352
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
2353
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
2354
+ }