@wireio/opp-solidity-models 1.0.6 → 1.0.8

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.
@@ -0,0 +1,666 @@
1
+ import { WireType } from "@protobuf-ts/runtime";
2
+ import { UnknownFieldHandler } from "@protobuf-ts/runtime";
3
+ import { reflectionMergePartial } from "@protobuf-ts/runtime";
4
+ import { MessageType } from "@protobuf-ts/runtime";
5
+ // ---------------------------------------------------------------------------
6
+ // Chain identifier
7
+ // ---------------------------------------------------------------------------
8
+ /**
9
+ * @generated from protobuf enum sysio.opp.types.ChainKind
10
+ */
11
+ export var ChainKind;
12
+ (function (ChainKind) {
13
+ /**
14
+ * @generated from protobuf enum value: CHAIN_KIND_UNKNOWN = 0;
15
+ */
16
+ ChainKind[ChainKind["UNKNOWN"] = 0] = "UNKNOWN";
17
+ /**
18
+ * @generated from protobuf enum value: CHAIN_KIND_WIRE = 1;
19
+ */
20
+ ChainKind[ChainKind["WIRE"] = 1] = "WIRE";
21
+ /**
22
+ * @generated from protobuf enum value: CHAIN_KIND_ETHEREUM = 2;
23
+ */
24
+ ChainKind[ChainKind["ETHEREUM"] = 2] = "ETHEREUM";
25
+ /**
26
+ * @generated from protobuf enum value: CHAIN_KIND_SOLANA = 3;
27
+ */
28
+ ChainKind[ChainKind["SOLANA"] = 3] = "SOLANA";
29
+ /**
30
+ * @generated from protobuf enum value: CHAIN_KIND_SUI = 4;
31
+ */
32
+ ChainKind[ChainKind["SUI"] = 4] = "SUI";
33
+ })(ChainKind || (ChainKind = {}));
34
+ /**
35
+ * @generated from protobuf enum sysio.opp.types.ChainKeyType
36
+ */
37
+ export var ChainKeyType;
38
+ (function (ChainKeyType) {
39
+ /**
40
+ * @generated from protobuf enum value: CHAIN_KEY_TYPE_UNKNOWN = 0;
41
+ */
42
+ ChainKeyType[ChainKeyType["UNKNOWN"] = 0] = "UNKNOWN";
43
+ /**
44
+ * @generated from protobuf enum value: CHAIN_KEY_TYPE_WIRE = 1;
45
+ */
46
+ ChainKeyType[ChainKeyType["WIRE"] = 1] = "WIRE";
47
+ /**
48
+ * @generated from protobuf enum value: CHAIN_KEY_TYPE_WIRE_BLS = 2;
49
+ */
50
+ ChainKeyType[ChainKeyType["WIRE_BLS"] = 2] = "WIRE_BLS";
51
+ /**
52
+ * @generated from protobuf enum value: CHAIN_KEY_TYPE_ETHEREUM = 3;
53
+ */
54
+ ChainKeyType[ChainKeyType["ETHEREUM"] = 3] = "ETHEREUM";
55
+ /**
56
+ * @generated from protobuf enum value: CHAIN_KEY_TYPE_SOLANA = 4;
57
+ */
58
+ ChainKeyType[ChainKeyType["SOLANA"] = 4] = "SOLANA";
59
+ /**
60
+ * @generated from protobuf enum value: CHAIN_KEY_TYPE_SUI = 5;
61
+ */
62
+ ChainKeyType[ChainKeyType["SUI"] = 5] = "SUI";
63
+ })(ChainKeyType || (ChainKeyType = {}));
64
+ /**
65
+ * Token identifier (upper byte encodes chain family).
66
+ *
67
+ * @generated from protobuf enum sysio.opp.types.TokenKind
68
+ */
69
+ export var TokenKind;
70
+ (function (TokenKind) {
71
+ /**
72
+ * 0x0000
73
+ *
74
+ * @generated from protobuf enum value: TOKEN_KIND_WIRE = 0;
75
+ */
76
+ TokenKind[TokenKind["WIRE"] = 0] = "WIRE";
77
+ /**
78
+ * 0x0100
79
+ *
80
+ * @generated from protobuf enum value: TOKEN_KIND_ETH = 256;
81
+ */
82
+ TokenKind[TokenKind["ETH"] = 256] = "ETH";
83
+ /**
84
+ * 0x01F0
85
+ *
86
+ * @generated from protobuf enum value: TOKEN_KIND_LIQETH = 496;
87
+ */
88
+ TokenKind[TokenKind["LIQETH"] = 496] = "LIQETH";
89
+ /**
90
+ * 0x0200
91
+ *
92
+ * @generated from protobuf enum value: TOKEN_KIND_SOL = 512;
93
+ */
94
+ TokenKind[TokenKind["SOL"] = 512] = "SOL";
95
+ /**
96
+ * 0x02F0
97
+ *
98
+ * @generated from protobuf enum value: TOKEN_KIND_LIQSOL = 752;
99
+ */
100
+ TokenKind[TokenKind["LIQSOL"] = 752] = "LIQSOL";
101
+ })(TokenKind || (TokenKind = {}));
102
+ // ---------------------------------------------------------------------------
103
+ // Encoding flags (originally a single uint8 bitfield)
104
+ //
105
+ // Decomposed into discrete fields for protobuf compatibility.
106
+ // Wire-format packing: endianness | (hash_algorithm << 1)
107
+ // | (length_encoding << 3) | reserved
108
+ // ---------------------------------------------------------------------------
109
+ /**
110
+ * @generated from protobuf enum sysio.opp.types.Endianness
111
+ */
112
+ export var Endianness;
113
+ (function (Endianness) {
114
+ /**
115
+ * 0x00
116
+ *
117
+ * @generated from protobuf enum value: ENDIANNESS_BIG = 0;
118
+ */
119
+ Endianness[Endianness["BIG"] = 0] = "BIG";
120
+ /**
121
+ * 0x01
122
+ *
123
+ * @generated from protobuf enum value: ENDIANNESS_LITTLE = 1;
124
+ */
125
+ Endianness[Endianness["LITTLE"] = 1] = "LITTLE";
126
+ })(Endianness || (Endianness = {}));
127
+ /**
128
+ * @generated from protobuf enum sysio.opp.types.HashAlgorithm
129
+ */
130
+ export var HashAlgorithm;
131
+ (function (HashAlgorithm) {
132
+ /**
133
+ * bits[2:1] = 00
134
+ *
135
+ * @generated from protobuf enum value: HASH_ALGORITHM_KECCAK256 = 0;
136
+ */
137
+ HashAlgorithm[HashAlgorithm["KECCAK256"] = 0] = "KECCAK256";
138
+ /**
139
+ * bits[2:1] = 01
140
+ *
141
+ * @generated from protobuf enum value: HASH_ALGORITHM_SHA256 = 1;
142
+ */
143
+ HashAlgorithm[HashAlgorithm["SHA256"] = 1] = "SHA256";
144
+ /**
145
+ * bits[2:1] = 10
146
+ *
147
+ * @generated from protobuf enum value: HASH_ALGORITHM_RESERVED_1 = 2;
148
+ */
149
+ HashAlgorithm[HashAlgorithm["RESERVED_1"] = 2] = "RESERVED_1";
150
+ /**
151
+ * bits[2:1] = 11
152
+ *
153
+ * @generated from protobuf enum value: HASH_ALGORITHM_RESERVED_2 = 3;
154
+ */
155
+ HashAlgorithm[HashAlgorithm["RESERVED_2"] = 3] = "RESERVED_2";
156
+ })(HashAlgorithm || (HashAlgorithm = {}));
157
+ /**
158
+ * @generated from protobuf enum sysio.opp.types.LengthEncoding
159
+ */
160
+ export var LengthEncoding;
161
+ (function (LengthEncoding) {
162
+ /**
163
+ * bit[3] = 0
164
+ *
165
+ * @generated from protobuf enum value: LENGTH_ENCODING_VARUINT = 0;
166
+ */
167
+ LengthEncoding[LengthEncoding["VARUINT"] = 0] = "VARUINT";
168
+ /**
169
+ * bit[3] = 1
170
+ *
171
+ * @generated from protobuf enum value: LENGTH_ENCODING_UINT32 = 1;
172
+ */
173
+ LengthEncoding[LengthEncoding["UINT32"] = 1] = "UINT32";
174
+ })(LengthEncoding || (LengthEncoding = {}));
175
+ // ---------------------------------------------------------------------------
176
+ // Attestation discriminant
177
+ // ---------------------------------------------------------------------------
178
+ /**
179
+ * @generated from protobuf enum sysio.opp.types.AttestationType
180
+ */
181
+ export var AttestationType;
182
+ (function (AttestationType) {
183
+ /**
184
+ * @generated from protobuf enum value: ATTESTATION_TYPE_UNSPECIFIED = 0;
185
+ */
186
+ AttestationType[AttestationType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
187
+ /**
188
+ * 0x0BB9
189
+ *
190
+ * @generated from protobuf enum value: ATTESTATION_TYPE_OPERATOR_ACTION = 2001;
191
+ */
192
+ AttestationType[AttestationType["OPERATOR_ACTION"] = 2001] = "OPERATOR_ACTION";
193
+ /**
194
+ * 0x0BB9
195
+ *
196
+ * @generated from protobuf enum value: ATTESTATION_TYPE_STAKE = 3001;
197
+ */
198
+ AttestationType[AttestationType["STAKE"] = 3001] = "STAKE";
199
+ /**
200
+ * 0x0BBA
201
+ *
202
+ * @generated from protobuf enum value: ATTESTATION_TYPE_UNSTAKE = 3002;
203
+ */
204
+ AttestationType[AttestationType["UNSTAKE"] = 3002] = "UNSTAKE";
205
+ /**
206
+ * 0x0BBB
207
+ *
208
+ * @generated from protobuf enum value: ATTESTATION_TYPE_PRETOKEN_PURCHASE = 3004;
209
+ */
210
+ AttestationType[AttestationType["PRETOKEN_PURCHASE"] = 3004] = "PRETOKEN_PURCHASE";
211
+ /**
212
+ * 0x0BBE
213
+ *
214
+ * @generated from protobuf enum value: ATTESTATION_TYPE_PRETOKEN_YIELD = 3006;
215
+ */
216
+ AttestationType[AttestationType["PRETOKEN_YIELD"] = 3006] = "PRETOKEN_YIELD";
217
+ /**
218
+ * 0xAA00
219
+ *
220
+ * @generated from protobuf enum value: ATTESTATION_TYPE_RESERVE_BALANCE_SHEET = 43520;
221
+ */
222
+ AttestationType[AttestationType["RESERVE_BALANCE_SHEET"] = 43520] = "RESERVE_BALANCE_SHEET";
223
+ /**
224
+ * 0xEE00
225
+ *
226
+ * @generated from protobuf enum value: ATTESTATION_TYPE_STAKE_UPDATE = 60928;
227
+ */
228
+ AttestationType[AttestationType["STAKE_UPDATE"] = 60928] = "STAKE_UPDATE";
229
+ /**
230
+ * 0xEE01
231
+ *
232
+ * @generated from protobuf enum value: ATTESTATION_TYPE_NATIVE_YIELD_REWARD = 60929;
233
+ */
234
+ AttestationType[AttestationType["NATIVE_YIELD_REWARD"] = 60929] = "NATIVE_YIELD_REWARD";
235
+ /**
236
+ * 0xEE02
237
+ *
238
+ * @generated from protobuf enum value: ATTESTATION_TYPE_WIRE_TOKEN_PURCHASE = 60930;
239
+ */
240
+ AttestationType[AttestationType["WIRE_TOKEN_PURCHASE"] = 60930] = "WIRE_TOKEN_PURCHASE";
241
+ /**
242
+ * 0xEE03
243
+ *
244
+ * @generated from protobuf enum value: ATTESTATION_TYPE_OPERATOR_REG_DEREG = 60931;
245
+ */
246
+ AttestationType[AttestationType["OPERATOR_REG_DEREG"] = 60931] = "OPERATOR_REG_DEREG";
247
+ /**
248
+ * 0xEE04
249
+ *
250
+ * @generated from protobuf enum value: ATTESTATION_TYPE_CHALLENGE_RESPONSE = 60932;
251
+ */
252
+ AttestationType[AttestationType["CHALLENGE_RESPONSE"] = 60932] = "CHALLENGE_RESPONSE";
253
+ /**
254
+ * 0xEE05
255
+ *
256
+ * @generated from protobuf enum value: ATTESTATION_TYPE_SLASH_OPERATOR = 60933;
257
+ */
258
+ AttestationType[AttestationType["SLASH_OPERATOR"] = 60933] = "SLASH_OPERATOR";
259
+ })(AttestationType || (AttestationType = {}));
260
+ // ---------------------------------------------------------------------------
261
+ // Staker / Operator lifecycle
262
+ // ---------------------------------------------------------------------------
263
+ /**
264
+ * @generated from protobuf enum sysio.opp.types.StakeStatus
265
+ */
266
+ export var StakeStatus;
267
+ (function (StakeStatus) {
268
+ /**
269
+ * @generated from protobuf enum value: STAKE_STATUS_UNKNOWN = 0;
270
+ */
271
+ StakeStatus[StakeStatus["UNKNOWN"] = 0] = "UNKNOWN";
272
+ /**
273
+ * 0x01
274
+ *
275
+ * @generated from protobuf enum value: STAKE_STATUS_WARMUP = 1;
276
+ */
277
+ StakeStatus[StakeStatus["WARMUP"] = 1] = "WARMUP";
278
+ /**
279
+ * 0x02
280
+ *
281
+ * @generated from protobuf enum value: STAKE_STATUS_COOLDOWN = 2;
282
+ */
283
+ StakeStatus[StakeStatus["COOLDOWN"] = 2] = "COOLDOWN";
284
+ /**
285
+ * 0x03
286
+ *
287
+ * @generated from protobuf enum value: STAKE_STATUS_ACTIVE = 3;
288
+ */
289
+ StakeStatus[StakeStatus["ACTIVE"] = 3] = "ACTIVE";
290
+ /**
291
+ * 0xF0
292
+ *
293
+ * @generated from protobuf enum value: STAKE_STATUS_TERMINATED = 240;
294
+ */
295
+ StakeStatus[StakeStatus["TERMINATED"] = 240] = "TERMINATED";
296
+ /**
297
+ * 0xF1
298
+ *
299
+ * @generated from protobuf enum value: STAKE_STATUS_SLASHED = 241;
300
+ */
301
+ StakeStatus[StakeStatus["SLASHED"] = 241] = "SLASHED";
302
+ })(StakeStatus || (StakeStatus = {}));
303
+ /**
304
+ * @generated from protobuf enum sysio.opp.types.OperatorType
305
+ */
306
+ export var OperatorType;
307
+ (function (OperatorType) {
308
+ /**
309
+ * @generated from protobuf enum value: OPERATOR_TYPE_UNKNOWN = 0;
310
+ */
311
+ OperatorType[OperatorType["UNKNOWN"] = 0] = "UNKNOWN";
312
+ /**
313
+ * 0x01
314
+ *
315
+ * @generated from protobuf enum value: OPERATOR_TYPE_PRODUCER = 1;
316
+ */
317
+ OperatorType[OperatorType["PRODUCER"] = 1] = "PRODUCER";
318
+ /**
319
+ * 0x02
320
+ *
321
+ * @generated from protobuf enum value: OPERATOR_TYPE_BATCH = 2;
322
+ */
323
+ OperatorType[OperatorType["BATCH"] = 2] = "BATCH";
324
+ /**
325
+ * 0x03
326
+ *
327
+ * @generated from protobuf enum value: OPERATOR_TYPE_UNDERWRITER = 3;
328
+ */
329
+ OperatorType[OperatorType["UNDERWRITER"] = 3] = "UNDERWRITER";
330
+ /**
331
+ * 0x04
332
+ *
333
+ * @generated from protobuf enum value: OPERATOR_TYPE_CHALLENGER = 4;
334
+ */
335
+ OperatorType[OperatorType["CHALLENGER"] = 4] = "CHALLENGER";
336
+ })(OperatorType || (OperatorType = {}));
337
+ /**
338
+ * @generated from protobuf enum sysio.opp.types.OperatorStatus
339
+ */
340
+ export var OperatorStatus;
341
+ (function (OperatorStatus) {
342
+ /**
343
+ * @generated from protobuf enum value: OPERATOR_STATUS_UNKNOWN = 0;
344
+ */
345
+ OperatorStatus[OperatorStatus["UNKNOWN"] = 0] = "UNKNOWN";
346
+ /**
347
+ * 0x01
348
+ *
349
+ * @generated from protobuf enum value: OPERATOR_STATUS_WARMUP = 1;
350
+ */
351
+ OperatorStatus[OperatorStatus["WARMUP"] = 1] = "WARMUP";
352
+ /**
353
+ * 0x02
354
+ *
355
+ * @generated from protobuf enum value: OPERATOR_STATUS_COOLDOWN = 2;
356
+ */
357
+ OperatorStatus[OperatorStatus["COOLDOWN"] = 2] = "COOLDOWN";
358
+ /**
359
+ * 0x03
360
+ *
361
+ * @generated from protobuf enum value: OPERATOR_STATUS_ACTIVE = 3;
362
+ */
363
+ OperatorStatus[OperatorStatus["ACTIVE"] = 3] = "ACTIVE";
364
+ /**
365
+ * 0xF0
366
+ *
367
+ * @generated from protobuf enum value: OPERATOR_STATUS_TERMINATED = 240;
368
+ */
369
+ OperatorStatus[OperatorStatus["TERMINATED"] = 240] = "TERMINATED";
370
+ /**
371
+ * 0xF1
372
+ *
373
+ * @generated from protobuf enum value: OPERATOR_STATUS_SLASHED = 241;
374
+ */
375
+ OperatorStatus[OperatorStatus["SLASHED"] = 241] = "SLASHED";
376
+ })(OperatorStatus || (OperatorStatus = {}));
377
+ // @generated message type with reflection information, may provide speed optimized methods
378
+ class ChainId$Type extends MessageType {
379
+ constructor() {
380
+ super("sysio.opp.types.ChainId", [
381
+ { no: 1, name: "kind", kind: "enum", T: () => ["sysio.opp.types.ChainKind", ChainKind, "CHAIN_KIND_"] },
382
+ { no: 2, name: "id", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
383
+ ]);
384
+ }
385
+ create(value) {
386
+ const message = globalThis.Object.create((this.messagePrototype));
387
+ message.kind = 0;
388
+ message.id = 0;
389
+ if (value !== undefined)
390
+ reflectionMergePartial(this, message, value);
391
+ return message;
392
+ }
393
+ internalBinaryRead(reader, length, options, target) {
394
+ let message = target ?? this.create(), end = reader.pos + length;
395
+ while (reader.pos < end) {
396
+ let [fieldNo, wireType] = reader.tag();
397
+ switch (fieldNo) {
398
+ case /* sysio.opp.types.ChainKind kind */ 1:
399
+ message.kind = reader.int32();
400
+ break;
401
+ case /* uint32 id */ 2:
402
+ message.id = reader.uint32();
403
+ break;
404
+ default:
405
+ let u = options.readUnknownField;
406
+ if (u === "throw")
407
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
408
+ let d = reader.skip(wireType);
409
+ if (u !== false)
410
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
411
+ }
412
+ }
413
+ return message;
414
+ }
415
+ internalBinaryWrite(message, writer, options) {
416
+ /* sysio.opp.types.ChainKind kind = 1; */
417
+ if (message.kind !== 0)
418
+ writer.tag(1, WireType.Varint).int32(message.kind);
419
+ /* uint32 id = 2; */
420
+ if (message.id !== 0)
421
+ writer.tag(2, WireType.Varint).uint32(message.id);
422
+ let u = options.writeUnknownFields;
423
+ if (u !== false)
424
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
425
+ return writer;
426
+ }
427
+ }
428
+ /**
429
+ * @generated MessageType for protobuf message sysio.opp.types.ChainId
430
+ */
431
+ export const ChainId = new ChainId$Type();
432
+ // @generated message type with reflection information, may provide speed optimized methods
433
+ class ChainAddress$Type extends MessageType {
434
+ constructor() {
435
+ super("sysio.opp.types.ChainAddress", [
436
+ { no: 1, name: "kind", kind: "enum", T: () => ["sysio.opp.types.ChainKind", ChainKind, "CHAIN_KIND_"] },
437
+ { no: 2, name: "address", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
438
+ ]);
439
+ }
440
+ create(value) {
441
+ const message = globalThis.Object.create((this.messagePrototype));
442
+ message.kind = 0;
443
+ message.address = new Uint8Array(0);
444
+ if (value !== undefined)
445
+ reflectionMergePartial(this, message, value);
446
+ return message;
447
+ }
448
+ internalBinaryRead(reader, length, options, target) {
449
+ let message = target ?? this.create(), end = reader.pos + length;
450
+ while (reader.pos < end) {
451
+ let [fieldNo, wireType] = reader.tag();
452
+ switch (fieldNo) {
453
+ case /* sysio.opp.types.ChainKind kind */ 1:
454
+ message.kind = reader.int32();
455
+ break;
456
+ case /* bytes address */ 2:
457
+ message.address = reader.bytes();
458
+ break;
459
+ default:
460
+ let u = options.readUnknownField;
461
+ if (u === "throw")
462
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
463
+ let d = reader.skip(wireType);
464
+ if (u !== false)
465
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
466
+ }
467
+ }
468
+ return message;
469
+ }
470
+ internalBinaryWrite(message, writer, options) {
471
+ /* sysio.opp.types.ChainKind kind = 1; */
472
+ if (message.kind !== 0)
473
+ writer.tag(1, WireType.Varint).int32(message.kind);
474
+ /* bytes address = 2; */
475
+ if (message.address.length)
476
+ writer.tag(2, WireType.LengthDelimited).bytes(message.address);
477
+ let u = options.writeUnknownFields;
478
+ if (u !== false)
479
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
480
+ return writer;
481
+ }
482
+ }
483
+ /**
484
+ * @generated MessageType for protobuf message sysio.opp.types.ChainAddress
485
+ */
486
+ export const ChainAddress = new ChainAddress$Type();
487
+ // @generated message type with reflection information, may provide speed optimized methods
488
+ class ChainSignature$Type extends MessageType {
489
+ constructor() {
490
+ super("sysio.opp.types.ChainSignature", [
491
+ { no: 1, name: "actor", kind: "message", T: () => ChainAddress },
492
+ { no: 2, name: "key_type", kind: "enum", T: () => ["sysio.opp.types.ChainKeyType", ChainKeyType, "CHAIN_KEY_TYPE_"] },
493
+ { no: 3, name: "signature", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }
494
+ ]);
495
+ }
496
+ create(value) {
497
+ const message = globalThis.Object.create((this.messagePrototype));
498
+ message.keyType = 0;
499
+ message.signature = new Uint8Array(0);
500
+ if (value !== undefined)
501
+ reflectionMergePartial(this, message, value);
502
+ return message;
503
+ }
504
+ internalBinaryRead(reader, length, options, target) {
505
+ let message = target ?? this.create(), end = reader.pos + length;
506
+ while (reader.pos < end) {
507
+ let [fieldNo, wireType] = reader.tag();
508
+ switch (fieldNo) {
509
+ case /* sysio.opp.types.ChainAddress actor */ 1:
510
+ message.actor = ChainAddress.internalBinaryRead(reader, reader.uint32(), options, message.actor);
511
+ break;
512
+ case /* sysio.opp.types.ChainKeyType key_type */ 2:
513
+ message.keyType = reader.int32();
514
+ break;
515
+ case /* bytes signature */ 3:
516
+ message.signature = reader.bytes();
517
+ break;
518
+ default:
519
+ let u = options.readUnknownField;
520
+ if (u === "throw")
521
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
522
+ let d = reader.skip(wireType);
523
+ if (u !== false)
524
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
525
+ }
526
+ }
527
+ return message;
528
+ }
529
+ internalBinaryWrite(message, writer, options) {
530
+ /* sysio.opp.types.ChainAddress actor = 1; */
531
+ if (message.actor)
532
+ ChainAddress.internalBinaryWrite(message.actor, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
533
+ /* sysio.opp.types.ChainKeyType key_type = 2; */
534
+ if (message.keyType !== 0)
535
+ writer.tag(2, WireType.Varint).int32(message.keyType);
536
+ /* bytes signature = 3; */
537
+ if (message.signature.length)
538
+ writer.tag(3, WireType.LengthDelimited).bytes(message.signature);
539
+ let u = options.writeUnknownFields;
540
+ if (u !== false)
541
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
542
+ return writer;
543
+ }
544
+ }
545
+ /**
546
+ * @generated MessageType for protobuf message sysio.opp.types.ChainSignature
547
+ */
548
+ export const ChainSignature = new ChainSignature$Type();
549
+ // @generated message type with reflection information, may provide speed optimized methods
550
+ class TokenAmount$Type extends MessageType {
551
+ constructor() {
552
+ super("sysio.opp.types.TokenAmount", [
553
+ { no: 1, name: "kind", kind: "enum", T: () => ["sysio.opp.types.TokenKind", TokenKind, "TOKEN_KIND_"] },
554
+ { no: 2, name: "amount", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
555
+ ]);
556
+ }
557
+ create(value) {
558
+ const message = globalThis.Object.create((this.messagePrototype));
559
+ message.kind = 0;
560
+ message.amount = 0n;
561
+ if (value !== undefined)
562
+ reflectionMergePartial(this, message, value);
563
+ return message;
564
+ }
565
+ internalBinaryRead(reader, length, options, target) {
566
+ let message = target ?? this.create(), end = reader.pos + length;
567
+ while (reader.pos < end) {
568
+ let [fieldNo, wireType] = reader.tag();
569
+ switch (fieldNo) {
570
+ case /* sysio.opp.types.TokenKind kind */ 1:
571
+ message.kind = reader.int32();
572
+ break;
573
+ case /* int64 amount */ 2:
574
+ message.amount = reader.int64().toBigInt();
575
+ break;
576
+ default:
577
+ let u = options.readUnknownField;
578
+ if (u === "throw")
579
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
580
+ let d = reader.skip(wireType);
581
+ if (u !== false)
582
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
583
+ }
584
+ }
585
+ return message;
586
+ }
587
+ internalBinaryWrite(message, writer, options) {
588
+ /* sysio.opp.types.TokenKind kind = 1; */
589
+ if (message.kind !== 0)
590
+ writer.tag(1, WireType.Varint).int32(message.kind);
591
+ /* int64 amount = 2; */
592
+ if (message.amount !== 0n)
593
+ writer.tag(2, WireType.Varint).int64(message.amount);
594
+ let u = options.writeUnknownFields;
595
+ if (u !== false)
596
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
597
+ return writer;
598
+ }
599
+ }
600
+ /**
601
+ * @generated MessageType for protobuf message sysio.opp.types.TokenAmount
602
+ */
603
+ export const TokenAmount = new TokenAmount$Type();
604
+ // @generated message type with reflection information, may provide speed optimized methods
605
+ class EncodingFlags$Type extends MessageType {
606
+ constructor() {
607
+ super("sysio.opp.types.EncodingFlags", [
608
+ { no: 1, name: "endianness", kind: "enum", T: () => ["sysio.opp.types.Endianness", Endianness, "ENDIANNESS_"] },
609
+ { no: 2, name: "hash_algorithm", kind: "enum", T: () => ["sysio.opp.types.HashAlgorithm", HashAlgorithm, "HASH_ALGORITHM_"] },
610
+ { no: 3, name: "length_encoding", kind: "enum", T: () => ["sysio.opp.types.LengthEncoding", LengthEncoding, "LENGTH_ENCODING_"] }
611
+ ]);
612
+ }
613
+ create(value) {
614
+ const message = globalThis.Object.create((this.messagePrototype));
615
+ message.endianness = 0;
616
+ message.hashAlgorithm = 0;
617
+ message.lengthEncoding = 0;
618
+ if (value !== undefined)
619
+ reflectionMergePartial(this, message, value);
620
+ return message;
621
+ }
622
+ internalBinaryRead(reader, length, options, target) {
623
+ let message = target ?? this.create(), end = reader.pos + length;
624
+ while (reader.pos < end) {
625
+ let [fieldNo, wireType] = reader.tag();
626
+ switch (fieldNo) {
627
+ case /* sysio.opp.types.Endianness endianness */ 1:
628
+ message.endianness = reader.int32();
629
+ break;
630
+ case /* sysio.opp.types.HashAlgorithm hash_algorithm */ 2:
631
+ message.hashAlgorithm = reader.int32();
632
+ break;
633
+ case /* sysio.opp.types.LengthEncoding length_encoding */ 3:
634
+ message.lengthEncoding = reader.int32();
635
+ break;
636
+ default:
637
+ let u = options.readUnknownField;
638
+ if (u === "throw")
639
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
640
+ let d = reader.skip(wireType);
641
+ if (u !== false)
642
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
643
+ }
644
+ }
645
+ return message;
646
+ }
647
+ internalBinaryWrite(message, writer, options) {
648
+ /* sysio.opp.types.Endianness endianness = 1; */
649
+ if (message.endianness !== 0)
650
+ writer.tag(1, WireType.Varint).int32(message.endianness);
651
+ /* sysio.opp.types.HashAlgorithm hash_algorithm = 2; */
652
+ if (message.hashAlgorithm !== 0)
653
+ writer.tag(2, WireType.Varint).int32(message.hashAlgorithm);
654
+ /* sysio.opp.types.LengthEncoding length_encoding = 3; */
655
+ if (message.lengthEncoding !== 0)
656
+ writer.tag(3, WireType.Varint).int32(message.lengthEncoding);
657
+ let u = options.writeUnknownFields;
658
+ if (u !== false)
659
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
660
+ return writer;
661
+ }
662
+ }
663
+ /**
664
+ * @generated MessageType for protobuf message sysio.opp.types.EncodingFlags
665
+ */
666
+ export const EncodingFlags = new EncodingFlags$Type();