@apibara/starknet 2.1.0-beta.23 → 2.1.0-beta.24

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.
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const protocol = require('@apibara/protocol');
4
- const schema = require('@effect/schema');
4
+ const codec = require('@apibara/protocol/codec');
5
5
  const Long = require('long');
6
6
  const _m0 = require('protobufjs/minimal.js');
7
7
  const starknet = require('@scure/starknet');
@@ -12,44 +12,25 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
12
12
  const Long__default = /*#__PURE__*/_interopDefaultCompat(Long);
13
13
  const _m0__default = /*#__PURE__*/_interopDefaultCompat(_m0);
14
14
 
15
- const _FieldElement = schema.Schema.TemplateLiteral(
16
- schema.Schema.Literal("0x"),
17
- schema.Schema.String
18
- );
19
- const FieldElementProto = schema.Schema.Struct({
20
- x0: schema.Schema.BigIntFromSelf,
21
- x1: schema.Schema.BigIntFromSelf,
22
- x2: schema.Schema.BigIntFromSelf,
23
- x3: schema.Schema.BigIntFromSelf
24
- });
25
- const FieldElement$1 = schema.Schema.transform(FieldElementProto, _FieldElement, {
26
- decode(value) {
27
- const x0 = value.x0.toString(16).padStart(16, "0");
28
- const x1 = value.x1.toString(16).padStart(16, "0");
29
- const x2 = value.x2.toString(16).padStart(16, "0");
30
- const x3 = value.x3.toString(16).padStart(16, "0");
31
- return `0x${x0}${x1}${x2}${x3}`;
32
- },
33
- encode(value) {
34
- const bn = BigInt(value);
35
- const hex = bn.toString(16).padStart(64, "0");
36
- const s = hex.length;
37
- const x3 = BigInt(`0x${hex.slice(s - 16, s)}`);
38
- const x2 = BigInt(`0x${hex.slice(s - 32, s - 16)}`);
39
- const x1 = BigInt(`0x${hex.slice(s - 48, s - 32)}`);
40
- const x0 = BigInt(`0x${hex.slice(s - 64, s - 48)}`);
15
+ const MAX_U64 = 0xffffffffffffffffn;
16
+ const FieldElement$1 = {
17
+ encode(x) {
18
+ const bn = BigInt(x);
19
+ const x3 = bn & MAX_U64;
20
+ const x2 = bn >> 64n & MAX_U64;
21
+ const x1 = bn >> 128n & MAX_U64;
22
+ const x0 = bn >> 192n & MAX_U64;
41
23
  return { x0, x1, x2, x3 };
24
+ },
25
+ decode(p) {
26
+ const x0 = p.x0 ?? 0n;
27
+ const x1 = p.x1 ?? 0n;
28
+ const x2 = p.x2 ?? 0n;
29
+ const x3 = p.x3 ?? 0n;
30
+ const bn = x3 + (x2 << 64n) + (x1 << 128n) + (x0 << 192n);
31
+ return `0x${bn.toString(16).padStart(64, "0")}`;
42
32
  }
43
- });
44
- const feltToProto = schema.Schema.encodeSync(FieldElement$1);
45
- const feltFromProto = schema.Schema.decodeSync(FieldElement$1);
46
-
47
- function tag(tag2) {
48
- return schema.Schema.Literal(tag2).pipe(
49
- schema.Schema.propertySignature,
50
- schema.Schema.fromKey("$case")
51
- );
52
- }
33
+ };
53
34
 
54
35
  const protobufPackage$2 = "starknet.v2";
55
36
  function createBaseFieldElement() {
@@ -5158,18 +5139,18 @@ function createBaseInvokeTransactionTrace() {
5158
5139
  const InvokeTransactionTrace$1 = {
5159
5140
  encode(message, writer = _m0__default.Writer.create()) {
5160
5141
  if (message.validateInvocation !== void 0) {
5161
- FunctionInvocation$1.encode(message.validateInvocation, writer.uint32(10).fork()).ldelim();
5142
+ FunctionInvocation.encode(message.validateInvocation, writer.uint32(10).fork()).ldelim();
5162
5143
  }
5163
5144
  switch (message.executeInvocation?.$case) {
5164
5145
  case "success":
5165
- FunctionInvocation$1.encode(message.executeInvocation.success, writer.uint32(18).fork()).ldelim();
5146
+ FunctionInvocation.encode(message.executeInvocation.success, writer.uint32(18).fork()).ldelim();
5166
5147
  break;
5167
5148
  case "reverted":
5168
5149
  ExecutionReverted$1.encode(message.executeInvocation.reverted, writer.uint32(26).fork()).ldelim();
5169
5150
  break;
5170
5151
  }
5171
5152
  if (message.feeTransferInvocation !== void 0) {
5172
- FunctionInvocation$1.encode(message.feeTransferInvocation, writer.uint32(34).fork()).ldelim();
5153
+ FunctionInvocation.encode(message.feeTransferInvocation, writer.uint32(34).fork()).ldelim();
5173
5154
  }
5174
5155
  return writer;
5175
5156
  },
@@ -5184,13 +5165,13 @@ const InvokeTransactionTrace$1 = {
5184
5165
  if (tag !== 10) {
5185
5166
  break;
5186
5167
  }
5187
- message.validateInvocation = FunctionInvocation$1.decode(reader, reader.uint32());
5168
+ message.validateInvocation = FunctionInvocation.decode(reader, reader.uint32());
5188
5169
  continue;
5189
5170
  case 2:
5190
5171
  if (tag !== 18) {
5191
5172
  break;
5192
5173
  }
5193
- message.executeInvocation = { $case: "success", success: FunctionInvocation$1.decode(reader, reader.uint32()) };
5174
+ message.executeInvocation = { $case: "success", success: FunctionInvocation.decode(reader, reader.uint32()) };
5194
5175
  continue;
5195
5176
  case 3:
5196
5177
  if (tag !== 26) {
@@ -5205,7 +5186,7 @@ const InvokeTransactionTrace$1 = {
5205
5186
  if (tag !== 34) {
5206
5187
  break;
5207
5188
  }
5208
- message.feeTransferInvocation = FunctionInvocation$1.decode(reader, reader.uint32());
5189
+ message.feeTransferInvocation = FunctionInvocation.decode(reader, reader.uint32());
5209
5190
  continue;
5210
5191
  }
5211
5192
  if ((tag & 7) === 4 || tag === 0) {
@@ -5217,24 +5198,24 @@ const InvokeTransactionTrace$1 = {
5217
5198
  },
5218
5199
  fromJSON(object) {
5219
5200
  return {
5220
- validateInvocation: isSet$1(object.validateInvocation) ? FunctionInvocation$1.fromJSON(object.validateInvocation) : void 0,
5221
- executeInvocation: isSet$1(object.success) ? { $case: "success", success: FunctionInvocation$1.fromJSON(object.success) } : isSet$1(object.reverted) ? { $case: "reverted", reverted: ExecutionReverted$1.fromJSON(object.reverted) } : void 0,
5222
- feeTransferInvocation: isSet$1(object.feeTransferInvocation) ? FunctionInvocation$1.fromJSON(object.feeTransferInvocation) : void 0
5201
+ validateInvocation: isSet$1(object.validateInvocation) ? FunctionInvocation.fromJSON(object.validateInvocation) : void 0,
5202
+ executeInvocation: isSet$1(object.success) ? { $case: "success", success: FunctionInvocation.fromJSON(object.success) } : isSet$1(object.reverted) ? { $case: "reverted", reverted: ExecutionReverted$1.fromJSON(object.reverted) } : void 0,
5203
+ feeTransferInvocation: isSet$1(object.feeTransferInvocation) ? FunctionInvocation.fromJSON(object.feeTransferInvocation) : void 0
5223
5204
  };
5224
5205
  },
5225
5206
  toJSON(message) {
5226
5207
  const obj = {};
5227
5208
  if (message.validateInvocation !== void 0) {
5228
- obj.validateInvocation = FunctionInvocation$1.toJSON(message.validateInvocation);
5209
+ obj.validateInvocation = FunctionInvocation.toJSON(message.validateInvocation);
5229
5210
  }
5230
5211
  if (message.executeInvocation?.$case === "success") {
5231
- obj.success = FunctionInvocation$1.toJSON(message.executeInvocation.success);
5212
+ obj.success = FunctionInvocation.toJSON(message.executeInvocation.success);
5232
5213
  }
5233
5214
  if (message.executeInvocation?.$case === "reverted") {
5234
5215
  obj.reverted = ExecutionReverted$1.toJSON(message.executeInvocation.reverted);
5235
5216
  }
5236
5217
  if (message.feeTransferInvocation !== void 0) {
5237
- obj.feeTransferInvocation = FunctionInvocation$1.toJSON(message.feeTransferInvocation);
5218
+ obj.feeTransferInvocation = FunctionInvocation.toJSON(message.feeTransferInvocation);
5238
5219
  }
5239
5220
  return obj;
5240
5221
  },
@@ -5243,11 +5224,11 @@ const InvokeTransactionTrace$1 = {
5243
5224
  },
5244
5225
  fromPartial(object) {
5245
5226
  const message = createBaseInvokeTransactionTrace();
5246
- message.validateInvocation = object.validateInvocation !== void 0 && object.validateInvocation !== null ? FunctionInvocation$1.fromPartial(object.validateInvocation) : void 0;
5227
+ message.validateInvocation = object.validateInvocation !== void 0 && object.validateInvocation !== null ? FunctionInvocation.fromPartial(object.validateInvocation) : void 0;
5247
5228
  if (object.executeInvocation?.$case === "success" && object.executeInvocation?.success !== void 0 && object.executeInvocation?.success !== null) {
5248
5229
  message.executeInvocation = {
5249
5230
  $case: "success",
5250
- success: FunctionInvocation$1.fromPartial(object.executeInvocation.success)
5231
+ success: FunctionInvocation.fromPartial(object.executeInvocation.success)
5251
5232
  };
5252
5233
  }
5253
5234
  if (object.executeInvocation?.$case === "reverted" && object.executeInvocation?.reverted !== void 0 && object.executeInvocation?.reverted !== null) {
@@ -5256,7 +5237,7 @@ const InvokeTransactionTrace$1 = {
5256
5237
  reverted: ExecutionReverted$1.fromPartial(object.executeInvocation.reverted)
5257
5238
  };
5258
5239
  }
5259
- message.feeTransferInvocation = object.feeTransferInvocation !== void 0 && object.feeTransferInvocation !== null ? FunctionInvocation$1.fromPartial(object.feeTransferInvocation) : void 0;
5240
+ message.feeTransferInvocation = object.feeTransferInvocation !== void 0 && object.feeTransferInvocation !== null ? FunctionInvocation.fromPartial(object.feeTransferInvocation) : void 0;
5260
5241
  return message;
5261
5242
  }
5262
5243
  };
@@ -5266,10 +5247,10 @@ function createBaseDeclareTransactionTrace() {
5266
5247
  const DeclareTransactionTrace$1 = {
5267
5248
  encode(message, writer = _m0__default.Writer.create()) {
5268
5249
  if (message.validateInvocation !== void 0) {
5269
- FunctionInvocation$1.encode(message.validateInvocation, writer.uint32(10).fork()).ldelim();
5250
+ FunctionInvocation.encode(message.validateInvocation, writer.uint32(10).fork()).ldelim();
5270
5251
  }
5271
5252
  if (message.feeTransferInvocation !== void 0) {
5272
- FunctionInvocation$1.encode(message.feeTransferInvocation, writer.uint32(18).fork()).ldelim();
5253
+ FunctionInvocation.encode(message.feeTransferInvocation, writer.uint32(18).fork()).ldelim();
5273
5254
  }
5274
5255
  return writer;
5275
5256
  },
@@ -5284,13 +5265,13 @@ const DeclareTransactionTrace$1 = {
5284
5265
  if (tag !== 10) {
5285
5266
  break;
5286
5267
  }
5287
- message.validateInvocation = FunctionInvocation$1.decode(reader, reader.uint32());
5268
+ message.validateInvocation = FunctionInvocation.decode(reader, reader.uint32());
5288
5269
  continue;
5289
5270
  case 2:
5290
5271
  if (tag !== 18) {
5291
5272
  break;
5292
5273
  }
5293
- message.feeTransferInvocation = FunctionInvocation$1.decode(reader, reader.uint32());
5274
+ message.feeTransferInvocation = FunctionInvocation.decode(reader, reader.uint32());
5294
5275
  continue;
5295
5276
  }
5296
5277
  if ((tag & 7) === 4 || tag === 0) {
@@ -5302,17 +5283,17 @@ const DeclareTransactionTrace$1 = {
5302
5283
  },
5303
5284
  fromJSON(object) {
5304
5285
  return {
5305
- validateInvocation: isSet$1(object.validateInvocation) ? FunctionInvocation$1.fromJSON(object.validateInvocation) : void 0,
5306
- feeTransferInvocation: isSet$1(object.feeTransferInvocation) ? FunctionInvocation$1.fromJSON(object.feeTransferInvocation) : void 0
5286
+ validateInvocation: isSet$1(object.validateInvocation) ? FunctionInvocation.fromJSON(object.validateInvocation) : void 0,
5287
+ feeTransferInvocation: isSet$1(object.feeTransferInvocation) ? FunctionInvocation.fromJSON(object.feeTransferInvocation) : void 0
5307
5288
  };
5308
5289
  },
5309
5290
  toJSON(message) {
5310
5291
  const obj = {};
5311
5292
  if (message.validateInvocation !== void 0) {
5312
- obj.validateInvocation = FunctionInvocation$1.toJSON(message.validateInvocation);
5293
+ obj.validateInvocation = FunctionInvocation.toJSON(message.validateInvocation);
5313
5294
  }
5314
5295
  if (message.feeTransferInvocation !== void 0) {
5315
- obj.feeTransferInvocation = FunctionInvocation$1.toJSON(message.feeTransferInvocation);
5296
+ obj.feeTransferInvocation = FunctionInvocation.toJSON(message.feeTransferInvocation);
5316
5297
  }
5317
5298
  return obj;
5318
5299
  },
@@ -5321,8 +5302,8 @@ const DeclareTransactionTrace$1 = {
5321
5302
  },
5322
5303
  fromPartial(object) {
5323
5304
  const message = createBaseDeclareTransactionTrace();
5324
- message.validateInvocation = object.validateInvocation !== void 0 && object.validateInvocation !== null ? FunctionInvocation$1.fromPartial(object.validateInvocation) : void 0;
5325
- message.feeTransferInvocation = object.feeTransferInvocation !== void 0 && object.feeTransferInvocation !== null ? FunctionInvocation$1.fromPartial(object.feeTransferInvocation) : void 0;
5305
+ message.validateInvocation = object.validateInvocation !== void 0 && object.validateInvocation !== null ? FunctionInvocation.fromPartial(object.validateInvocation) : void 0;
5306
+ message.feeTransferInvocation = object.feeTransferInvocation !== void 0 && object.feeTransferInvocation !== null ? FunctionInvocation.fromPartial(object.feeTransferInvocation) : void 0;
5326
5307
  return message;
5327
5308
  }
5328
5309
  };
@@ -5332,13 +5313,13 @@ function createBaseDeployAccountTransactionTrace() {
5332
5313
  const DeployAccountTransactionTrace$1 = {
5333
5314
  encode(message, writer = _m0__default.Writer.create()) {
5334
5315
  if (message.validateInvocation !== void 0) {
5335
- FunctionInvocation$1.encode(message.validateInvocation, writer.uint32(10).fork()).ldelim();
5316
+ FunctionInvocation.encode(message.validateInvocation, writer.uint32(10).fork()).ldelim();
5336
5317
  }
5337
5318
  if (message.constructorInvocation !== void 0) {
5338
- FunctionInvocation$1.encode(message.constructorInvocation, writer.uint32(18).fork()).ldelim();
5319
+ FunctionInvocation.encode(message.constructorInvocation, writer.uint32(18).fork()).ldelim();
5339
5320
  }
5340
5321
  if (message.feeTransferInvocation !== void 0) {
5341
- FunctionInvocation$1.encode(message.feeTransferInvocation, writer.uint32(26).fork()).ldelim();
5322
+ FunctionInvocation.encode(message.feeTransferInvocation, writer.uint32(26).fork()).ldelim();
5342
5323
  }
5343
5324
  return writer;
5344
5325
  },
@@ -5353,19 +5334,19 @@ const DeployAccountTransactionTrace$1 = {
5353
5334
  if (tag !== 10) {
5354
5335
  break;
5355
5336
  }
5356
- message.validateInvocation = FunctionInvocation$1.decode(reader, reader.uint32());
5337
+ message.validateInvocation = FunctionInvocation.decode(reader, reader.uint32());
5357
5338
  continue;
5358
5339
  case 2:
5359
5340
  if (tag !== 18) {
5360
5341
  break;
5361
5342
  }
5362
- message.constructorInvocation = FunctionInvocation$1.decode(reader, reader.uint32());
5343
+ message.constructorInvocation = FunctionInvocation.decode(reader, reader.uint32());
5363
5344
  continue;
5364
5345
  case 3:
5365
5346
  if (tag !== 26) {
5366
5347
  break;
5367
5348
  }
5368
- message.feeTransferInvocation = FunctionInvocation$1.decode(reader, reader.uint32());
5349
+ message.feeTransferInvocation = FunctionInvocation.decode(reader, reader.uint32());
5369
5350
  continue;
5370
5351
  }
5371
5352
  if ((tag & 7) === 4 || tag === 0) {
@@ -5377,21 +5358,21 @@ const DeployAccountTransactionTrace$1 = {
5377
5358
  },
5378
5359
  fromJSON(object) {
5379
5360
  return {
5380
- validateInvocation: isSet$1(object.validateInvocation) ? FunctionInvocation$1.fromJSON(object.validateInvocation) : void 0,
5381
- constructorInvocation: isSet$1(object.constructorInvocation) ? FunctionInvocation$1.fromJSON(object.constructorInvocation) : void 0,
5382
- feeTransferInvocation: isSet$1(object.feeTransferInvocation) ? FunctionInvocation$1.fromJSON(object.feeTransferInvocation) : void 0
5361
+ validateInvocation: isSet$1(object.validateInvocation) ? FunctionInvocation.fromJSON(object.validateInvocation) : void 0,
5362
+ constructorInvocation: isSet$1(object.constructorInvocation) ? FunctionInvocation.fromJSON(object.constructorInvocation) : void 0,
5363
+ feeTransferInvocation: isSet$1(object.feeTransferInvocation) ? FunctionInvocation.fromJSON(object.feeTransferInvocation) : void 0
5383
5364
  };
5384
5365
  },
5385
5366
  toJSON(message) {
5386
5367
  const obj = {};
5387
5368
  if (message.validateInvocation !== void 0) {
5388
- obj.validateInvocation = FunctionInvocation$1.toJSON(message.validateInvocation);
5369
+ obj.validateInvocation = FunctionInvocation.toJSON(message.validateInvocation);
5389
5370
  }
5390
5371
  if (message.constructorInvocation !== void 0) {
5391
- obj.constructorInvocation = FunctionInvocation$1.toJSON(message.constructorInvocation);
5372
+ obj.constructorInvocation = FunctionInvocation.toJSON(message.constructorInvocation);
5392
5373
  }
5393
5374
  if (message.feeTransferInvocation !== void 0) {
5394
- obj.feeTransferInvocation = FunctionInvocation$1.toJSON(message.feeTransferInvocation);
5375
+ obj.feeTransferInvocation = FunctionInvocation.toJSON(message.feeTransferInvocation);
5395
5376
  }
5396
5377
  return obj;
5397
5378
  },
@@ -5400,9 +5381,9 @@ const DeployAccountTransactionTrace$1 = {
5400
5381
  },
5401
5382
  fromPartial(object) {
5402
5383
  const message = createBaseDeployAccountTransactionTrace();
5403
- message.validateInvocation = object.validateInvocation !== void 0 && object.validateInvocation !== null ? FunctionInvocation$1.fromPartial(object.validateInvocation) : void 0;
5404
- message.constructorInvocation = object.constructorInvocation !== void 0 && object.constructorInvocation !== null ? FunctionInvocation$1.fromPartial(object.constructorInvocation) : void 0;
5405
- message.feeTransferInvocation = object.feeTransferInvocation !== void 0 && object.feeTransferInvocation !== null ? FunctionInvocation$1.fromPartial(object.feeTransferInvocation) : void 0;
5384
+ message.validateInvocation = object.validateInvocation !== void 0 && object.validateInvocation !== null ? FunctionInvocation.fromPartial(object.validateInvocation) : void 0;
5385
+ message.constructorInvocation = object.constructorInvocation !== void 0 && object.constructorInvocation !== null ? FunctionInvocation.fromPartial(object.constructorInvocation) : void 0;
5386
+ message.feeTransferInvocation = object.feeTransferInvocation !== void 0 && object.feeTransferInvocation !== null ? FunctionInvocation.fromPartial(object.feeTransferInvocation) : void 0;
5406
5387
  return message;
5407
5388
  }
5408
5389
  };
@@ -5412,7 +5393,7 @@ function createBaseL1HandlerTransactionTrace() {
5412
5393
  const L1HandlerTransactionTrace$1 = {
5413
5394
  encode(message, writer = _m0__default.Writer.create()) {
5414
5395
  if (message.functionInvocation !== void 0) {
5415
- FunctionInvocation$1.encode(message.functionInvocation, writer.uint32(18).fork()).ldelim();
5396
+ FunctionInvocation.encode(message.functionInvocation, writer.uint32(18).fork()).ldelim();
5416
5397
  }
5417
5398
  return writer;
5418
5399
  },
@@ -5427,7 +5408,7 @@ const L1HandlerTransactionTrace$1 = {
5427
5408
  if (tag !== 18) {
5428
5409
  break;
5429
5410
  }
5430
- message.functionInvocation = FunctionInvocation$1.decode(reader, reader.uint32());
5411
+ message.functionInvocation = FunctionInvocation.decode(reader, reader.uint32());
5431
5412
  continue;
5432
5413
  }
5433
5414
  if ((tag & 7) === 4 || tag === 0) {
@@ -5439,13 +5420,13 @@ const L1HandlerTransactionTrace$1 = {
5439
5420
  },
5440
5421
  fromJSON(object) {
5441
5422
  return {
5442
- functionInvocation: isSet$1(object.functionInvocation) ? FunctionInvocation$1.fromJSON(object.functionInvocation) : void 0
5423
+ functionInvocation: isSet$1(object.functionInvocation) ? FunctionInvocation.fromJSON(object.functionInvocation) : void 0
5443
5424
  };
5444
5425
  },
5445
5426
  toJSON(message) {
5446
5427
  const obj = {};
5447
5428
  if (message.functionInvocation !== void 0) {
5448
- obj.functionInvocation = FunctionInvocation$1.toJSON(message.functionInvocation);
5429
+ obj.functionInvocation = FunctionInvocation.toJSON(message.functionInvocation);
5449
5430
  }
5450
5431
  return obj;
5451
5432
  },
@@ -5454,7 +5435,7 @@ const L1HandlerTransactionTrace$1 = {
5454
5435
  },
5455
5436
  fromPartial(object) {
5456
5437
  const message = createBaseL1HandlerTransactionTrace();
5457
- message.functionInvocation = object.functionInvocation !== void 0 && object.functionInvocation !== null ? FunctionInvocation$1.fromPartial(object.functionInvocation) : void 0;
5438
+ message.functionInvocation = object.functionInvocation !== void 0 && object.functionInvocation !== null ? FunctionInvocation.fromPartial(object.functionInvocation) : void 0;
5458
5439
  return message;
5459
5440
  }
5460
5441
  };
@@ -5472,7 +5453,7 @@ function createBaseFunctionInvocation() {
5472
5453
  messages: []
5473
5454
  };
5474
5455
  }
5475
- const FunctionInvocation$1 = {
5456
+ const FunctionInvocation = {
5476
5457
  encode(message, writer = _m0__default.Writer.create()) {
5477
5458
  if (message.contractAddress !== void 0) {
5478
5459
  FieldElement.encode(message.contractAddress, writer.uint32(10).fork()).ldelim();
@@ -5501,7 +5482,7 @@ const FunctionInvocation$1 = {
5501
5482
  }
5502
5483
  if (message.calls !== void 0 && message.calls.length !== 0) {
5503
5484
  for (const v of message.calls) {
5504
- FunctionInvocation$1.encode(v, writer.uint32(66).fork()).ldelim();
5485
+ FunctionInvocation.encode(v, writer.uint32(66).fork()).ldelim();
5505
5486
  }
5506
5487
  }
5507
5488
  if (message.events !== void 0 && message.events.length !== 0) {
@@ -5573,7 +5554,7 @@ const FunctionInvocation$1 = {
5573
5554
  if (tag !== 66) {
5574
5555
  break;
5575
5556
  }
5576
- message.calls.push(FunctionInvocation$1.decode(reader, reader.uint32()));
5557
+ message.calls.push(FunctionInvocation.decode(reader, reader.uint32()));
5577
5558
  continue;
5578
5559
  case 9:
5579
5560
  if (tag === 72) {
@@ -5618,7 +5599,7 @@ const FunctionInvocation$1 = {
5618
5599
  classHash: isSet$1(object.classHash) ? FieldElement.fromJSON(object.classHash) : void 0,
5619
5600
  callType: isSet$1(object.callType) ? callTypeFromJSON(object.callType) : 0,
5620
5601
  result: globalThis.Array.isArray(object?.result) ? object.result.map((e) => FieldElement.fromJSON(e)) : [],
5621
- calls: globalThis.Array.isArray(object?.calls) ? object.calls.map((e) => FunctionInvocation$1.fromJSON(e)) : [],
5602
+ calls: globalThis.Array.isArray(object?.calls) ? object.calls.map((e) => FunctionInvocation.fromJSON(e)) : [],
5622
5603
  events: globalThis.Array.isArray(object?.events) ? object.events.map((e) => globalThis.Number(e)) : [],
5623
5604
  messages: globalThis.Array.isArray(object?.messages) ? object.messages.map((e) => globalThis.Number(e)) : []
5624
5605
  };
@@ -5647,7 +5628,7 @@ const FunctionInvocation$1 = {
5647
5628
  obj.result = message.result.map((e) => FieldElement.toJSON(e));
5648
5629
  }
5649
5630
  if (message.calls?.length) {
5650
- obj.calls = message.calls.map((e) => FunctionInvocation$1.toJSON(e));
5631
+ obj.calls = message.calls.map((e) => FunctionInvocation.toJSON(e));
5651
5632
  }
5652
5633
  if (message.events?.length) {
5653
5634
  obj.events = message.events.map((e) => Math.round(e));
@@ -5658,7 +5639,7 @@ const FunctionInvocation$1 = {
5658
5639
  return obj;
5659
5640
  },
5660
5641
  create(base) {
5661
- return FunctionInvocation$1.fromPartial(base ?? {});
5642
+ return FunctionInvocation.fromPartial(base ?? {});
5662
5643
  },
5663
5644
  fromPartial(object) {
5664
5645
  const message = createBaseFunctionInvocation();
@@ -5669,7 +5650,7 @@ const FunctionInvocation$1 = {
5669
5650
  message.classHash = object.classHash !== void 0 && object.classHash !== null ? FieldElement.fromPartial(object.classHash) : void 0;
5670
5651
  message.callType = object.callType ?? 0;
5671
5652
  message.result = object.result?.map((e) => FieldElement.fromPartial(e)) || [];
5672
- message.calls = object.calls?.map((e) => FunctionInvocation$1.fromPartial(e)) || [];
5653
+ message.calls = object.calls?.map((e) => FunctionInvocation.fromPartial(e)) || [];
5673
5654
  message.events = object.events?.map((e) => e) || [];
5674
5655
  message.messages = object.messages?.map((e) => e) || [];
5675
5656
  return message;
@@ -5840,7 +5821,7 @@ const data = {
5840
5821
  ExecutionSucceeded: ExecutionSucceeded$1,
5841
5822
  FeePayment: FeePayment$1,
5842
5823
  FunctionCall: FunctionCall,
5843
- FunctionInvocation: FunctionInvocation$1,
5824
+ FunctionInvocation: FunctionInvocation,
5844
5825
  InvokeTransactionReceipt: InvokeTransactionReceipt$1,
5845
5826
  InvokeTransactionTrace: InvokeTransactionTrace$1,
5846
5827
  InvokeTransactionV0: InvokeTransactionV0$1,
@@ -7639,745 +7620,642 @@ const index = {
7639
7620
  filter: filter
7640
7621
  };
7641
7622
 
7642
- const ResourcePrice = schema.Schema.Struct({
7643
- priceInFri: schema.Schema.optional(FieldElement$1),
7644
- priceInWei: schema.Schema.optional(FieldElement$1)
7623
+ const ResourcePrice = codec.MessageCodec({
7624
+ priceInFri: codec.OptionalCodec(FieldElement$1),
7625
+ priceInWei: codec.OptionalCodec(FieldElement$1)
7645
7626
  });
7646
- const L1DataAvailabilityMode = schema.Schema.transform(
7647
- schema.Schema.Enums(L1DataAvailabilityMode$1),
7648
- schema.Schema.Literal("blob", "calldata", "unknown"),
7649
- {
7650
- decode(value) {
7651
- const enumMap = {
7652
- [L1DataAvailabilityMode$1.CALLDATA]: "calldata",
7653
- [L1DataAvailabilityMode$1.BLOB]: "blob",
7654
- [L1DataAvailabilityMode$1.UNSPECIFIED]: "unknown",
7655
- [L1DataAvailabilityMode$1.UNRECOGNIZED]: "unknown"
7656
- };
7657
- return enumMap[value] ?? "unknown";
7658
- },
7659
- encode(value) {
7660
- throw new Error("encode: not implemented");
7661
- }
7627
+ const L1DataAvailabilityMode = {
7628
+ encode(x) {
7629
+ switch (x) {
7630
+ case "calldata":
7631
+ return L1DataAvailabilityMode$1.CALLDATA;
7632
+ case "blob":
7633
+ return L1DataAvailabilityMode$1.BLOB;
7634
+ case "unknown":
7635
+ return L1DataAvailabilityMode$1.UNSPECIFIED;
7636
+ default:
7637
+ return L1DataAvailabilityMode$1.UNRECOGNIZED;
7638
+ }
7639
+ },
7640
+ decode(p) {
7641
+ const enumMap = {
7642
+ [L1DataAvailabilityMode$1.CALLDATA]: "calldata",
7643
+ [L1DataAvailabilityMode$1.BLOB]: "blob",
7644
+ [L1DataAvailabilityMode$1.UNSPECIFIED]: "unknown",
7645
+ [L1DataAvailabilityMode$1.UNRECOGNIZED]: "unknown"
7646
+ };
7647
+ return enumMap[p] ?? "unknown";
7662
7648
  }
7663
- );
7664
- const TransactionStatus = schema.Schema.transform(
7665
- schema.Schema.Enums(TransactionStatus$1),
7666
- schema.Schema.Literal("unknown", "succeeded", "reverted"),
7667
- {
7668
- decode(value) {
7669
- const enumMap = {
7670
- [TransactionStatus$1.SUCCEEDED]: "succeeded",
7671
- [TransactionStatus$1.REVERTED]: "reverted",
7672
- [TransactionStatus$1.UNSPECIFIED]: "unknown",
7673
- [TransactionStatus$1.UNRECOGNIZED]: "unknown"
7674
- };
7675
- return enumMap[value] ?? "unknown";
7676
- },
7677
- encode(value) {
7678
- throw new Error("encode: not implemented");
7679
- }
7649
+ };
7650
+ const TransactionStatus = {
7651
+ encode(x) {
7652
+ switch (x) {
7653
+ case "succeeded":
7654
+ return TransactionStatus$1.SUCCEEDED;
7655
+ case "reverted":
7656
+ return TransactionStatus$1.REVERTED;
7657
+ case "unknown":
7658
+ return TransactionStatus$1.UNSPECIFIED;
7659
+ default:
7660
+ return TransactionStatus$1.UNRECOGNIZED;
7661
+ }
7662
+ },
7663
+ decode(p) {
7664
+ const enumMap = {
7665
+ [TransactionStatus$1.SUCCEEDED]: "succeeded",
7666
+ [TransactionStatus$1.REVERTED]: "reverted",
7667
+ [TransactionStatus$1.UNSPECIFIED]: "unknown",
7668
+ [TransactionStatus$1.UNRECOGNIZED]: "unknown"
7669
+ };
7670
+ return enumMap[p] ?? "unknown";
7680
7671
  }
7681
- );
7682
- const U128 = schema.Schema.transform(
7683
- schema.Schema.Struct({
7684
- x0: schema.Schema.BigIntFromSelf,
7685
- x1: schema.Schema.BigIntFromSelf
7686
- }),
7687
- schema.Schema.BigIntFromSelf,
7688
- {
7689
- decode(value) {
7690
- const low = value.x0.toString(16).padStart(16, "0");
7691
- const high = value.x1.toString(16).padStart(16, "0");
7692
- return BigInt(`0x${low}${high}`);
7693
- },
7694
- encode(value) {
7695
- throw new Error("encode: not implemented");
7696
- }
7672
+ };
7673
+ const U128 = {
7674
+ // TODO: double check if this is correct
7675
+ encode(x) {
7676
+ const low = x.toString(16).padStart(16, "0");
7677
+ const high = (x >> 128n).toString(16).padStart(16, "0");
7678
+ return { x0: BigInt(`0x${low}`), x1: BigInt(`0x${high}`) };
7679
+ },
7680
+ decode(p) {
7681
+ const low = (p.x0 ?? 0n).toString(16).padStart(16, "0");
7682
+ const high = (p.x1 ?? 0n).toString(16).padStart(16, "0");
7683
+ return BigInt(`0x${low}${high}`);
7697
7684
  }
7698
- );
7699
- const ResourceBounds = schema.Schema.Struct({
7700
- maxAmount: schema.Schema.BigIntFromSelf,
7701
- maxPricePerUnit: U128
7685
+ };
7686
+ const ResourceBounds = codec.MessageCodec({
7687
+ maxAmount: codec.RequiredCodec(codec.BigIntCodec),
7688
+ maxPricePerUnit: codec.RequiredCodec(U128)
7702
7689
  });
7703
- const ResourceBoundsMapping = schema.Schema.Struct({
7704
- l1Gas: ResourceBounds,
7705
- l2Gas: ResourceBounds
7690
+ const ResourceBoundsMapping = codec.MessageCodec({
7691
+ l1Gas: codec.RequiredCodec(ResourceBounds),
7692
+ l2Gas: codec.RequiredCodec(ResourceBounds)
7706
7693
  });
7707
- const DataAvailabilityMode = schema.Schema.transform(
7708
- schema.Schema.Enums(DataAvailabilityMode$1),
7709
- schema.Schema.Literal("l1", "l2", "unknown"),
7710
- {
7711
- decode(value) {
7712
- const enumMap = {
7713
- [DataAvailabilityMode$1.L1]: "l1",
7714
- [DataAvailabilityMode$1.L2]: "l2",
7715
- [DataAvailabilityMode$1.UNSPECIFIED]: "unknown",
7716
- [DataAvailabilityMode$1.UNRECOGNIZED]: "unknown"
7717
- };
7718
- return enumMap[value] ?? "unknown";
7719
- },
7720
- encode(value) {
7721
- throw new Error("encode: not implemented");
7722
- }
7694
+ const DataAvailabilityMode = {
7695
+ encode(x) {
7696
+ switch (x) {
7697
+ case "l1":
7698
+ return DataAvailabilityMode$1.L1;
7699
+ case "l2":
7700
+ return DataAvailabilityMode$1.L2;
7701
+ case "unknown":
7702
+ return DataAvailabilityMode$1.UNSPECIFIED;
7703
+ default:
7704
+ return DataAvailabilityMode$1.UNRECOGNIZED;
7705
+ }
7706
+ },
7707
+ decode(p) {
7708
+ const enumMap = {
7709
+ [DataAvailabilityMode$1.L1]: "l1",
7710
+ [DataAvailabilityMode$1.L2]: "l2",
7711
+ [DataAvailabilityMode$1.UNSPECIFIED]: "unknown",
7712
+ [DataAvailabilityMode$1.UNRECOGNIZED]: "unknown"
7713
+ };
7714
+ return enumMap[p] ?? "unknown";
7723
7715
  }
7724
- );
7725
- const BlockHeader = schema.Schema.Struct({
7726
- blockHash: schema.Schema.optional(FieldElement$1),
7727
- parentBlockHash: FieldElement$1,
7728
- blockNumber: schema.Schema.BigIntFromSelf,
7729
- sequencerAddress: FieldElement$1,
7730
- newRoot: schema.Schema.optional(FieldElement$1),
7731
- timestamp: schema.Schema.DateFromSelf,
7732
- starknetVersion: schema.Schema.String,
7733
- l1GasPrice: ResourcePrice,
7734
- l1DataGasPrice: ResourcePrice,
7735
- l1DataAvailabilityMode: L1DataAvailabilityMode
7716
+ };
7717
+ const BlockHeader = codec.MessageCodec({
7718
+ blockHash: codec.RequiredCodec(FieldElement$1),
7719
+ parentBlockHash: codec.RequiredCodec(FieldElement$1),
7720
+ blockNumber: codec.RequiredCodec(codec.BigIntCodec),
7721
+ sequencerAddress: codec.RequiredCodec(FieldElement$1),
7722
+ newRoot: codec.OptionalCodec(FieldElement$1),
7723
+ timestamp: codec.RequiredCodec(codec.DateCodec),
7724
+ starknetVersion: codec.RequiredCodec(codec.StringCodec),
7725
+ l1GasPrice: codec.RequiredCodec(ResourcePrice),
7726
+ l1DataGasPrice: codec.RequiredCodec(ResourcePrice),
7727
+ l1DataAvailabilityMode: codec.RequiredCodec(L1DataAvailabilityMode)
7736
7728
  });
7737
- const TransactionMeta = schema.Schema.Struct({
7738
- transactionIndex: schema.Schema.Number,
7739
- transactionHash: FieldElement$1,
7740
- transactionStatus: TransactionStatus
7729
+ const TransactionMeta = codec.MessageCodec({
7730
+ transactionIndex: codec.RequiredCodec(codec.NumberCodec),
7731
+ transactionHash: codec.RequiredCodec(FieldElement$1),
7732
+ transactionStatus: codec.RequiredCodec(TransactionStatus)
7741
7733
  });
7742
- const InvokeTransactionV0 = schema.Schema.Struct({
7743
- _tag: tag("invokeV0"),
7744
- invokeV0: schema.Schema.Struct({
7745
- maxFee: FieldElement$1,
7746
- signature: schema.Schema.Array(FieldElement$1),
7747
- contractAddress: FieldElement$1,
7748
- entryPointSelector: FieldElement$1,
7749
- calldata: schema.Schema.Array(FieldElement$1)
7750
- })
7734
+ const InvokeTransactionV0 = codec.MessageCodec({
7735
+ maxFee: codec.RequiredCodec(FieldElement$1),
7736
+ signature: codec.ArrayCodec(FieldElement$1),
7737
+ contractAddress: codec.RequiredCodec(FieldElement$1),
7738
+ entryPointSelector: codec.RequiredCodec(FieldElement$1),
7739
+ calldata: codec.ArrayCodec(FieldElement$1)
7751
7740
  });
7752
- const InvokeTransactionV1 = schema.Schema.Struct({
7753
- _tag: tag("invokeV1"),
7754
- invokeV1: schema.Schema.Struct({
7755
- senderAddress: FieldElement$1,
7756
- calldata: schema.Schema.Array(FieldElement$1),
7757
- maxFee: FieldElement$1,
7758
- signature: schema.Schema.Array(FieldElement$1),
7759
- nonce: FieldElement$1
7760
- })
7741
+ const InvokeTransactionV1 = codec.MessageCodec({
7742
+ senderAddress: codec.RequiredCodec(FieldElement$1),
7743
+ calldata: codec.ArrayCodec(FieldElement$1),
7744
+ maxFee: codec.RequiredCodec(FieldElement$1),
7745
+ signature: codec.ArrayCodec(FieldElement$1),
7746
+ nonce: codec.RequiredCodec(FieldElement$1)
7761
7747
  });
7762
- const InvokeTransactionV3 = schema.Schema.Struct({
7763
- _tag: tag("invokeV3"),
7764
- invokeV3: schema.Schema.Struct({
7765
- senderAddress: FieldElement$1,
7766
- calldata: schema.Schema.Array(FieldElement$1),
7767
- signature: schema.Schema.Array(FieldElement$1),
7768
- nonce: FieldElement$1,
7769
- resourceBounds: ResourceBoundsMapping,
7770
- tip: schema.Schema.BigIntFromSelf,
7771
- paymasterData: schema.Schema.Array(FieldElement$1),
7772
- accountDeploymentData: schema.Schema.Array(FieldElement$1),
7773
- nonceDataAvailabilityMode: DataAvailabilityMode,
7774
- feeDataAvailabilityMode: DataAvailabilityMode
7775
- })
7748
+ const InvokeTransactionV3 = codec.MessageCodec({
7749
+ senderAddress: codec.RequiredCodec(FieldElement$1),
7750
+ calldata: codec.ArrayCodec(FieldElement$1),
7751
+ signature: codec.ArrayCodec(FieldElement$1),
7752
+ nonce: codec.RequiredCodec(FieldElement$1),
7753
+ resourceBounds: codec.RequiredCodec(ResourceBoundsMapping),
7754
+ tip: codec.RequiredCodec(codec.BigIntCodec),
7755
+ paymasterData: codec.ArrayCodec(FieldElement$1),
7756
+ accountDeploymentData: codec.ArrayCodec(FieldElement$1),
7757
+ nonceDataAvailabilityMode: codec.RequiredCodec(DataAvailabilityMode),
7758
+ feeDataAvailabilityMode: codec.RequiredCodec(DataAvailabilityMode)
7776
7759
  });
7777
- const L1HandlerTransaction = schema.Schema.Struct({
7778
- _tag: tag("l1Handler"),
7779
- l1Handler: schema.Schema.Struct({
7780
- nonce: schema.Schema.BigIntFromSelf,
7781
- contractAddress: FieldElement$1,
7782
- entryPointSelector: FieldElement$1,
7783
- calldata: schema.Schema.Array(FieldElement$1)
7784
- })
7760
+ const L1HandlerTransaction = codec.MessageCodec({
7761
+ nonce: codec.RequiredCodec(codec.BigIntCodec),
7762
+ contractAddress: codec.RequiredCodec(FieldElement$1),
7763
+ entryPointSelector: codec.RequiredCodec(FieldElement$1),
7764
+ calldata: codec.ArrayCodec(FieldElement$1)
7785
7765
  });
7786
- const DeployTransaction = schema.Schema.Struct({
7787
- _tag: tag("deploy"),
7788
- deploy: schema.Schema.Struct({
7789
- contractAddressSalt: FieldElement$1,
7790
- constructorCalldata: schema.Schema.Array(FieldElement$1),
7791
- classHash: FieldElement$1
7792
- })
7766
+ const DeployTransaction = codec.MessageCodec({
7767
+ contractAddressSalt: codec.RequiredCodec(FieldElement$1),
7768
+ constructorCalldata: codec.ArrayCodec(FieldElement$1),
7769
+ classHash: codec.RequiredCodec(FieldElement$1)
7793
7770
  });
7794
- const DeclareTransactionV0 = schema.Schema.Struct({
7795
- _tag: tag("declareV0"),
7796
- declareV0: schema.Schema.Struct({
7797
- senderAddress: FieldElement$1,
7798
- maxFee: FieldElement$1,
7799
- signature: schema.Schema.Array(FieldElement$1),
7800
- classHash: FieldElement$1
7801
- })
7771
+ const DeclareTransactionV0 = codec.MessageCodec({
7772
+ senderAddress: codec.RequiredCodec(FieldElement$1),
7773
+ maxFee: codec.RequiredCodec(FieldElement$1),
7774
+ signature: codec.ArrayCodec(FieldElement$1),
7775
+ classHash: codec.RequiredCodec(FieldElement$1)
7802
7776
  });
7803
- const DeclareTransactionV1 = schema.Schema.Struct({
7804
- _tag: tag("declareV1"),
7805
- declareV1: schema.Schema.Struct({
7806
- senderAddress: FieldElement$1,
7807
- maxFee: FieldElement$1,
7808
- signature: schema.Schema.Array(FieldElement$1),
7809
- nonce: FieldElement$1,
7810
- classHash: FieldElement$1
7811
- })
7777
+ const DeclareTransactionV1 = codec.MessageCodec({
7778
+ senderAddress: codec.RequiredCodec(FieldElement$1),
7779
+ maxFee: codec.RequiredCodec(FieldElement$1),
7780
+ signature: codec.ArrayCodec(FieldElement$1),
7781
+ nonce: codec.RequiredCodec(FieldElement$1),
7782
+ classHash: codec.RequiredCodec(FieldElement$1)
7812
7783
  });
7813
- const DeclareTransactionV2 = schema.Schema.Struct({
7814
- _tag: tag("declareV2"),
7815
- declareV2: schema.Schema.Struct({
7816
- senderAddress: FieldElement$1,
7817
- compiledClassHash: FieldElement$1,
7818
- maxFee: FieldElement$1,
7819
- signature: schema.Schema.Array(FieldElement$1),
7820
- nonce: FieldElement$1,
7821
- classHash: FieldElement$1
7822
- })
7784
+ const DeclareTransactionV2 = codec.MessageCodec({
7785
+ senderAddress: codec.RequiredCodec(FieldElement$1),
7786
+ compiledClassHash: codec.RequiredCodec(FieldElement$1),
7787
+ maxFee: codec.RequiredCodec(FieldElement$1),
7788
+ signature: codec.ArrayCodec(FieldElement$1),
7789
+ nonce: codec.RequiredCodec(FieldElement$1),
7790
+ classHash: codec.RequiredCodec(FieldElement$1)
7823
7791
  });
7824
- const DeclareTransactionV3 = schema.Schema.Struct({
7825
- _tag: tag("declareV3"),
7826
- declareV3: schema.Schema.Struct({
7827
- senderAddress: FieldElement$1,
7828
- compiledClassHash: FieldElement$1,
7829
- signature: schema.Schema.Array(FieldElement$1),
7830
- nonce: FieldElement$1,
7831
- classHash: FieldElement$1,
7832
- resourceBounds: ResourceBoundsMapping,
7833
- tip: schema.Schema.BigIntFromSelf,
7834
- paymasterData: schema.Schema.Array(FieldElement$1),
7835
- accountDeploymentData: schema.Schema.Array(FieldElement$1),
7836
- nonceDataAvailabilityMode: DataAvailabilityMode,
7837
- feeDataAvailabilityMode: DataAvailabilityMode
7838
- })
7792
+ const DeclareTransactionV3 = codec.MessageCodec({
7793
+ senderAddress: codec.RequiredCodec(FieldElement$1),
7794
+ compiledClassHash: codec.RequiredCodec(FieldElement$1),
7795
+ signature: codec.ArrayCodec(FieldElement$1),
7796
+ nonce: codec.RequiredCodec(FieldElement$1),
7797
+ classHash: codec.RequiredCodec(FieldElement$1),
7798
+ resourceBounds: codec.RequiredCodec(ResourceBoundsMapping),
7799
+ tip: codec.RequiredCodec(codec.BigIntCodec),
7800
+ paymasterData: codec.ArrayCodec(FieldElement$1),
7801
+ accountDeploymentData: codec.ArrayCodec(FieldElement$1),
7802
+ nonceDataAvailabilityMode: codec.RequiredCodec(DataAvailabilityMode),
7803
+ feeDataAvailabilityMode: codec.RequiredCodec(DataAvailabilityMode)
7839
7804
  });
7840
- const DeployAccountTransactionV1 = schema.Schema.Struct({
7841
- _tag: tag("deployAccountV1"),
7842
- deployAccountV1: schema.Schema.Struct({
7843
- maxFee: FieldElement$1,
7844
- signature: schema.Schema.Array(FieldElement$1),
7845
- nonce: FieldElement$1,
7846
- contractAddressSalt: FieldElement$1,
7847
- constructorCalldata: schema.Schema.Array(FieldElement$1),
7848
- classHash: FieldElement$1
7849
- })
7805
+ const DeployAccountTransactionV1 = codec.MessageCodec({
7806
+ maxFee: codec.RequiredCodec(FieldElement$1),
7807
+ signature: codec.ArrayCodec(FieldElement$1),
7808
+ nonce: codec.RequiredCodec(FieldElement$1),
7809
+ contractAddressSalt: codec.RequiredCodec(FieldElement$1),
7810
+ constructorCalldata: codec.ArrayCodec(FieldElement$1),
7811
+ classHash: codec.RequiredCodec(FieldElement$1)
7850
7812
  });
7851
- const DeployAccountTransactionV3 = schema.Schema.Struct({
7852
- _tag: tag("deployAccountV3"),
7853
- deployAccountV3: schema.Schema.Struct({
7854
- signature: schema.Schema.Array(FieldElement$1),
7855
- nonce: FieldElement$1,
7856
- contractAddressSalt: FieldElement$1,
7857
- constructorCalldata: schema.Schema.Array(FieldElement$1),
7858
- classHash: FieldElement$1,
7859
- resourceBounds: ResourceBoundsMapping,
7860
- tip: schema.Schema.BigIntFromSelf,
7861
- paymasterData: schema.Schema.Array(FieldElement$1),
7862
- nonceDataAvailabilityMode: DataAvailabilityMode,
7863
- feeDataAvailabilityMode: DataAvailabilityMode
7864
- })
7813
+ const DeployAccountTransactionV3 = codec.MessageCodec({
7814
+ signature: codec.ArrayCodec(FieldElement$1),
7815
+ nonce: codec.RequiredCodec(FieldElement$1),
7816
+ contractAddressSalt: codec.RequiredCodec(FieldElement$1),
7817
+ constructorCalldata: codec.ArrayCodec(FieldElement$1),
7818
+ classHash: codec.RequiredCodec(FieldElement$1),
7819
+ resourceBounds: codec.RequiredCodec(ResourceBoundsMapping),
7820
+ tip: codec.RequiredCodec(codec.BigIntCodec),
7821
+ paymasterData: codec.ArrayCodec(FieldElement$1),
7822
+ nonceDataAvailabilityMode: codec.RequiredCodec(DataAvailabilityMode),
7823
+ feeDataAvailabilityMode: codec.RequiredCodec(DataAvailabilityMode)
7865
7824
  });
7866
- const Transaction = schema.Schema.Struct({
7867
- filterIds: schema.Schema.Array(schema.Schema.Number),
7868
- meta: TransactionMeta,
7869
- transaction: schema.Schema.Union(
7870
- InvokeTransactionV0,
7871
- InvokeTransactionV1,
7872
- InvokeTransactionV3,
7873
- L1HandlerTransaction,
7874
- DeployTransaction,
7875
- DeclareTransactionV0,
7876
- DeclareTransactionV1,
7877
- DeclareTransactionV2,
7878
- DeclareTransactionV3,
7879
- DeployAccountTransactionV1,
7880
- DeployAccountTransactionV3
7825
+ const Transaction = codec.MessageCodec({
7826
+ filterIds: codec.ArrayCodec(codec.NumberCodec),
7827
+ meta: codec.RequiredCodec(TransactionMeta),
7828
+ transaction: codec.RequiredCodec(
7829
+ codec.OneOfCodec({
7830
+ invokeV0: InvokeTransactionV0,
7831
+ invokeV1: InvokeTransactionV1,
7832
+ invokeV3: InvokeTransactionV3,
7833
+ l1Handler: L1HandlerTransaction,
7834
+ deploy: DeployTransaction,
7835
+ declareV0: DeclareTransactionV0,
7836
+ declareV1: DeclareTransactionV1,
7837
+ declareV2: DeclareTransactionV2,
7838
+ declareV3: DeclareTransactionV3,
7839
+ deployAccountV1: DeployAccountTransactionV1,
7840
+ deployAccountV3: DeployAccountTransactionV3
7841
+ })
7881
7842
  )
7882
7843
  });
7883
- const PriceUnit = schema.Schema.transform(
7884
- schema.Schema.Enums(PriceUnit$1),
7885
- schema.Schema.Literal("wei", "fri", "unknown"),
7886
- {
7887
- decode(value) {
7888
- const enumMap = {
7889
- [PriceUnit$1.WEI]: "wei",
7890
- [PriceUnit$1.FRI]: "fri",
7891
- [PriceUnit$1.UNSPECIFIED]: "unknown",
7892
- [PriceUnit$1.UNRECOGNIZED]: "unknown"
7893
- };
7894
- return enumMap[value] ?? "unknown";
7895
- },
7896
- encode(value) {
7897
- throw new Error("encode: not implemented");
7898
- }
7844
+ const PriceUnit = {
7845
+ encode(x) {
7846
+ switch (x) {
7847
+ case "wei":
7848
+ return PriceUnit$1.WEI;
7849
+ case "fri":
7850
+ return PriceUnit$1.FRI;
7851
+ case "unknown":
7852
+ return PriceUnit$1.UNSPECIFIED;
7853
+ default:
7854
+ return PriceUnit$1.UNRECOGNIZED;
7855
+ }
7856
+ },
7857
+ decode(p) {
7858
+ const enumMap = {
7859
+ [PriceUnit$1.WEI]: "wei",
7860
+ [PriceUnit$1.FRI]: "fri",
7861
+ [PriceUnit$1.UNSPECIFIED]: "unknown",
7862
+ [PriceUnit$1.UNRECOGNIZED]: "unknown"
7863
+ };
7864
+ return enumMap[p] ?? "unknown";
7899
7865
  }
7900
- );
7901
- const FeePayment = schema.Schema.Struct({
7902
- amount: FieldElement$1,
7903
- unit: PriceUnit
7904
- });
7905
- const ComputationResources = schema.Schema.Struct({
7906
- steps: schema.Schema.BigIntFromSelf,
7907
- memoryHoles: schema.Schema.optional(schema.Schema.BigIntFromSelf),
7908
- rangeCheckBuiltinApplications: schema.Schema.optional(schema.Schema.BigIntFromSelf),
7909
- pedersenBuiltinApplications: schema.Schema.optional(schema.Schema.BigIntFromSelf),
7910
- poseidonBuiltinApplications: schema.Schema.optional(schema.Schema.BigIntFromSelf),
7911
- ecOpBuiltinApplications: schema.Schema.optional(schema.Schema.BigIntFromSelf),
7912
- ecdsaBuiltinApplications: schema.Schema.optional(schema.Schema.BigIntFromSelf),
7913
- bitwiseBuiltinApplications: schema.Schema.optional(schema.Schema.BigIntFromSelf),
7914
- keccakBuiltinApplications: schema.Schema.optional(schema.Schema.BigIntFromSelf),
7915
- segmentArenaBuiltin: schema.Schema.optional(schema.Schema.BigIntFromSelf)
7916
- });
7917
- const DataAvailabilityResources = schema.Schema.Struct({
7918
- l1Gas: schema.Schema.BigIntFromSelf,
7919
- l1DataGas: schema.Schema.BigIntFromSelf
7920
- });
7921
- const ExecutionResources = schema.Schema.Struct({
7922
- computation: ComputationResources,
7923
- dataAvailability: DataAvailabilityResources
7866
+ };
7867
+ const FeePayment = codec.MessageCodec({
7868
+ amount: codec.RequiredCodec(FieldElement$1),
7869
+ unit: codec.RequiredCodec(PriceUnit)
7924
7870
  });
7925
- const ExecutionSucceeded = schema.Schema.Struct({
7926
- _tag: tag("succeeded"),
7927
- succeeded: schema.Schema.Struct({})
7871
+ const ComputationResources = codec.MessageCodec({
7872
+ steps: codec.RequiredCodec(codec.BigIntCodec),
7873
+ memoryHoles: codec.OptionalCodec(codec.BigIntCodec),
7874
+ rangeCheckBuiltinApplications: codec.OptionalCodec(codec.BigIntCodec),
7875
+ pedersenBuiltinApplications: codec.OptionalCodec(codec.BigIntCodec),
7876
+ poseidonBuiltinApplications: codec.OptionalCodec(codec.BigIntCodec),
7877
+ ecOpBuiltinApplications: codec.OptionalCodec(codec.BigIntCodec),
7878
+ ecdsaBuiltinApplications: codec.OptionalCodec(codec.BigIntCodec),
7879
+ bitwiseBuiltinApplications: codec.OptionalCodec(codec.BigIntCodec),
7880
+ keccakBuiltinApplications: codec.OptionalCodec(codec.BigIntCodec),
7881
+ segmentArenaBuiltin: codec.OptionalCodec(codec.BigIntCodec)
7928
7882
  });
7929
- const ExecutionReverted = schema.Schema.Struct({
7930
- _tag: tag("reverted"),
7931
- reverted: schema.Schema.Struct({
7932
- reason: schema.Schema.optional(schema.Schema.String)
7933
- })
7883
+ const DataAvailabilityResources = codec.MessageCodec({
7884
+ l1Gas: codec.RequiredCodec(codec.BigIntCodec),
7885
+ l1DataGas: codec.RequiredCodec(codec.BigIntCodec)
7934
7886
  });
7935
- const TransactionReceiptMeta = schema.Schema.Struct({
7936
- transactionIndex: schema.Schema.Number,
7937
- transactionHash: FieldElement$1,
7938
- actualFee: FeePayment,
7939
- executionResources: ExecutionResources,
7940
- executionResult: schema.Schema.Union(ExecutionSucceeded, ExecutionReverted)
7887
+ const ExecutionResources = codec.MessageCodec({
7888
+ computation: codec.RequiredCodec(ComputationResources),
7889
+ dataAvailability: codec.RequiredCodec(DataAvailabilityResources)
7941
7890
  });
7942
- const InvokeTransactionReceipt = schema.Schema.Struct({
7943
- _tag: tag("invoke"),
7944
- invoke: schema.Schema.Struct({})
7891
+ const ExecutionSucceeded = codec.MessageCodec({});
7892
+ const ExecutionReverted = codec.MessageCodec({
7893
+ reason: codec.OptionalCodec(codec.StringCodec)
7945
7894
  });
7946
- const L1HandlerTransactionReceipt = schema.Schema.Struct({
7947
- _tag: tag("l1Handler"),
7948
- l1Handler: schema.Schema.Struct({
7949
- messageHash: schema.Schema.Uint8ArrayFromSelf
7950
- })
7895
+ const TransactionReceiptMeta = codec.MessageCodec({
7896
+ transactionIndex: codec.RequiredCodec(codec.NumberCodec),
7897
+ transactionHash: codec.RequiredCodec(FieldElement$1),
7898
+ actualFee: codec.RequiredCodec(FeePayment),
7899
+ executionResources: codec.RequiredCodec(ExecutionResources),
7900
+ executionResult: codec.RequiredCodec(
7901
+ codec.OneOfCodec({
7902
+ succeeded: ExecutionSucceeded,
7903
+ reverted: ExecutionReverted
7904
+ })
7905
+ )
7951
7906
  });
7952
- const DeclareTransactionReceipt = schema.Schema.Struct({
7953
- _tag: tag("declare"),
7954
- declare: schema.Schema.Struct({})
7907
+ const InvokeTransactionReceipt = codec.MessageCodec({});
7908
+ const L1HandlerTransactionReceipt = codec.MessageCodec({
7909
+ messageHash: codec.RequiredCodec(codec.Uint8ArrayCodec)
7955
7910
  });
7956
- const DeployTransactionReceipt = schema.Schema.Struct({
7957
- _tag: tag("deploy"),
7958
- deploy: schema.Schema.Struct({
7959
- contractAddress: FieldElement$1
7960
- })
7911
+ const DeclareTransactionReceipt = codec.MessageCodec({});
7912
+ const DeployTransactionReceipt = codec.MessageCodec({
7913
+ contractAddress: codec.RequiredCodec(FieldElement$1)
7961
7914
  });
7962
- const DeployAccountTransactionReceipt = schema.Schema.Struct({
7963
- _tag: tag("deployAccount"),
7964
- deployAccount: schema.Schema.Struct({
7965
- contractAddress: FieldElement$1
7966
- })
7915
+ const DeployAccountTransactionReceipt = codec.MessageCodec({
7916
+ contractAddress: codec.RequiredCodec(FieldElement$1)
7967
7917
  });
7968
- const TransactionReceipt = schema.Schema.Struct({
7969
- filterIds: schema.Schema.Array(schema.Schema.Number),
7970
- meta: TransactionReceiptMeta,
7971
- receipt: schema.Schema.Union(
7972
- InvokeTransactionReceipt,
7973
- L1HandlerTransactionReceipt,
7974
- DeclareTransactionReceipt,
7975
- DeployTransactionReceipt,
7976
- DeployAccountTransactionReceipt
7918
+ const TransactionReceipt = codec.MessageCodec({
7919
+ filterIds: codec.ArrayCodec(codec.NumberCodec),
7920
+ meta: codec.RequiredCodec(TransactionReceiptMeta),
7921
+ receipt: codec.RequiredCodec(
7922
+ codec.OneOfCodec({
7923
+ invoke: InvokeTransactionReceipt,
7924
+ l1Handler: L1HandlerTransactionReceipt,
7925
+ declare: DeclareTransactionReceipt,
7926
+ deploy: DeployTransactionReceipt,
7927
+ deployAccount: DeployAccountTransactionReceipt
7928
+ })
7977
7929
  )
7978
7930
  });
7979
- const Event = schema.Schema.Struct({
7980
- filterIds: schema.Schema.Array(schema.Schema.Number),
7981
- address: FieldElement$1,
7982
- keys: schema.Schema.Array(FieldElement$1),
7983
- data: schema.Schema.Array(FieldElement$1),
7984
- eventIndex: schema.Schema.Number,
7985
- transactionIndex: schema.Schema.Number,
7986
- transactionHash: FieldElement$1,
7987
- transactionStatus: TransactionStatus,
7988
- eventIndexInTransaction: schema.Schema.Number
7931
+ const Event = codec.MessageCodec({
7932
+ filterIds: codec.ArrayCodec(codec.NumberCodec),
7933
+ address: codec.RequiredCodec(FieldElement$1),
7934
+ keys: codec.ArrayCodec(FieldElement$1),
7935
+ data: codec.ArrayCodec(FieldElement$1),
7936
+ eventIndex: codec.RequiredCodec(codec.NumberCodec),
7937
+ transactionIndex: codec.RequiredCodec(codec.NumberCodec),
7938
+ transactionHash: codec.RequiredCodec(FieldElement$1),
7939
+ transactionStatus: codec.RequiredCodec(TransactionStatus),
7940
+ eventIndexInTransaction: codec.RequiredCodec(codec.NumberCodec)
7989
7941
  });
7990
- const MessageToL1 = schema.Schema.Struct({
7991
- filterIds: schema.Schema.Array(schema.Schema.Number),
7992
- fromAddress: FieldElement$1,
7993
- toAddress: FieldElement$1,
7994
- payload: schema.Schema.Array(FieldElement$1),
7995
- messageIndex: schema.Schema.Number,
7996
- transactionIndex: schema.Schema.Number,
7997
- transactionHash: FieldElement$1,
7998
- transactionStatus: TransactionStatus,
7999
- messageIndexInTransaction: schema.Schema.Number
7942
+ const MessageToL1 = codec.MessageCodec({
7943
+ filterIds: codec.ArrayCodec(codec.NumberCodec),
7944
+ fromAddress: codec.RequiredCodec(FieldElement$1),
7945
+ toAddress: codec.RequiredCodec(FieldElement$1),
7946
+ payload: codec.ArrayCodec(FieldElement$1),
7947
+ messageIndex: codec.RequiredCodec(codec.NumberCodec),
7948
+ transactionIndex: codec.RequiredCodec(codec.NumberCodec),
7949
+ transactionHash: codec.RequiredCodec(FieldElement$1),
7950
+ transactionStatus: codec.RequiredCodec(TransactionStatus),
7951
+ messageIndexInTransaction: codec.RequiredCodec(codec.NumberCodec)
8000
7952
  });
8001
- const StorageEntry = schema.Schema.Struct({
8002
- key: FieldElement$1,
8003
- value: FieldElement$1
7953
+ const StorageEntry = codec.MessageCodec({
7954
+ key: codec.RequiredCodec(FieldElement$1),
7955
+ value: codec.RequiredCodec(FieldElement$1)
8004
7956
  });
8005
- const StorageDiff = schema.Schema.Struct({
8006
- filterIds: schema.Schema.Array(schema.Schema.Number),
8007
- contractAddress: FieldElement$1,
8008
- storageEntries: schema.Schema.Array(StorageEntry)
7957
+ const StorageDiff = codec.MessageCodec({
7958
+ filterIds: codec.ArrayCodec(codec.NumberCodec),
7959
+ contractAddress: codec.RequiredCodec(FieldElement$1),
7960
+ storageEntries: codec.ArrayCodec(StorageEntry)
8009
7961
  });
8010
- const DeclaredClass = schema.Schema.Struct({
8011
- _tag: tag("declaredClass"),
8012
- declaredClass: schema.Schema.Struct({
8013
- classHash: schema.Schema.optional(FieldElement$1),
8014
- compiledClassHash: schema.Schema.optional(FieldElement$1)
8015
- })
7962
+ const DeclaredClass = codec.MessageCodec({
7963
+ classHash: codec.OptionalCodec(FieldElement$1),
7964
+ compiledClassHash: codec.OptionalCodec(FieldElement$1)
8016
7965
  });
8017
- const ReplacedClass = schema.Schema.Struct({
8018
- _tag: tag("replacedClass"),
8019
- replacedClass: schema.Schema.Struct({
8020
- contractAddress: schema.Schema.optional(FieldElement$1),
8021
- classHash: schema.Schema.optional(FieldElement$1)
8022
- })
7966
+ const ReplacedClass = codec.MessageCodec({
7967
+ contractAddress: codec.OptionalCodec(FieldElement$1),
7968
+ classHash: codec.OptionalCodec(FieldElement$1)
8023
7969
  });
8024
- const DeployedContract = schema.Schema.Struct({
8025
- _tag: tag("deployedContract"),
8026
- deployedContract: schema.Schema.Struct({
8027
- contractAddress: schema.Schema.optional(FieldElement$1),
8028
- classHash: schema.Schema.optional(FieldElement$1)
8029
- })
7970
+ const DeployedContract = codec.MessageCodec({
7971
+ contractAddress: codec.OptionalCodec(FieldElement$1),
7972
+ classHash: codec.OptionalCodec(FieldElement$1)
8030
7973
  });
8031
- const ContractChange = schema.Schema.Struct({
8032
- filterIds: schema.Schema.Array(schema.Schema.Number),
8033
- change: schema.Schema.Union(DeclaredClass, ReplacedClass, DeployedContract)
7974
+ const ContractChange = codec.MessageCodec({
7975
+ filterIds: codec.ArrayCodec(codec.NumberCodec),
7976
+ change: codec.RequiredCodec(
7977
+ codec.OneOfCodec({
7978
+ declaredClass: DeclaredClass,
7979
+ replacedClass: ReplacedClass,
7980
+ deployedContract: DeployedContract
7981
+ })
7982
+ )
8034
7983
  });
8035
- const NonceUpdate = schema.Schema.Struct({
8036
- filterIds: schema.Schema.Array(schema.Schema.Number),
8037
- contractAddress: FieldElement$1,
8038
- nonce: FieldElement$1
7984
+ const NonceUpdate = codec.MessageCodec({
7985
+ filterIds: codec.ArrayCodec(codec.NumberCodec),
7986
+ contractAddress: codec.RequiredCodec(FieldElement$1),
7987
+ nonce: codec.RequiredCodec(FieldElement$1)
8039
7988
  });
8040
- const CallType = schema.Schema.transform(
8041
- schema.Schema.Enums(CallType$1),
8042
- schema.Schema.Literal("libraryCall", "call", "delegate", "unknown"),
8043
- {
8044
- decode(value) {
8045
- const enumMap = {
8046
- [CallType$1.LIBRARY_CALL]: "libraryCall",
8047
- [CallType$1.CALL]: "call",
8048
- [CallType$1.DELEGATE]: "delegate",
8049
- [CallType$1.UNSPECIFIED]: "unknown",
8050
- [CallType$1.UNRECOGNIZED]: "unknown"
8051
- };
8052
- return enumMap[value] ?? "unknown";
8053
- },
8054
- encode(value) {
8055
- throw new Error("encode: not implemented");
8056
- }
7989
+ const CallType = {
7990
+ encode(x) {
7991
+ switch (x) {
7992
+ case "libraryCall":
7993
+ return CallType$1.LIBRARY_CALL;
7994
+ case "call":
7995
+ return CallType$1.CALL;
7996
+ case "delegate":
7997
+ return CallType$1.DELEGATE;
7998
+ case "unknown":
7999
+ return CallType$1.UNSPECIFIED;
8000
+ default:
8001
+ return CallType$1.UNRECOGNIZED;
8002
+ }
8003
+ },
8004
+ decode(p) {
8005
+ const enumMap = {
8006
+ [CallType$1.LIBRARY_CALL]: "libraryCall",
8007
+ [CallType$1.CALL]: "call",
8008
+ [CallType$1.DELEGATE]: "delegate",
8009
+ [CallType$1.UNSPECIFIED]: "unknown",
8010
+ [CallType$1.UNRECOGNIZED]: "unknown"
8011
+ };
8012
+ return enumMap[p] ?? "unknown";
8057
8013
  }
8058
- );
8059
- class FunctionInvocation extends schema.Schema.Class(
8060
- "FunctionInvocation"
8061
- )({
8062
- contractAddress: FieldElement$1,
8063
- entryPointSelector: FieldElement$1,
8064
- calldata: schema.Schema.Array(FieldElement$1),
8065
- callerAddress: FieldElement$1,
8066
- classHash: FieldElement$1,
8067
- callType: CallType,
8068
- result: schema.Schema.Array(FieldElement$1),
8069
- calls: schema.Schema.suspend(
8070
- // biome-ignore lint/suspicious/noExplicitAny: not possible otherwise
8071
- () => schema.Schema.Array(FunctionInvocation)
8072
- ),
8073
- events: schema.Schema.Array(schema.Schema.Number),
8074
- messages: schema.Schema.Array(schema.Schema.Number)
8075
- }) {
8076
- }
8077
- const ExecuteInvocationSuccess = schema.Schema.Struct({
8078
- _tag: tag("success"),
8079
- success: FunctionInvocation
8014
+ };
8015
+ const _FunctionInvocationCodec = codec.MessageCodec({
8016
+ contractAddress: codec.RequiredCodec(FieldElement$1),
8017
+ entryPointSelector: codec.RequiredCodec(FieldElement$1),
8018
+ calldata: codec.ArrayCodec(FieldElement$1),
8019
+ callerAddress: codec.RequiredCodec(FieldElement$1),
8020
+ classHash: codec.RequiredCodec(FieldElement$1),
8021
+ callType: codec.RequiredCodec(CallType),
8022
+ result: codec.ArrayCodec(FieldElement$1),
8023
+ events: codec.ArrayCodec(codec.NumberCodec),
8024
+ messages: codec.ArrayCodec(codec.NumberCodec)
8080
8025
  });
8081
- const ExecuteInvocationReverted = schema.Schema.Struct({
8082
- _tag: tag("reverted"),
8083
- reverted: schema.Schema.Struct({
8084
- reason: schema.Schema.optional(schema.Schema.String)
8085
- })
8026
+ const FunctionInvocationCodec = {
8027
+ encode(x) {
8028
+ const { calls, ...rest } = x;
8029
+ const encodedCalls = calls.map(FunctionInvocationCodec.encode);
8030
+ const encodedRest = _FunctionInvocationCodec.encode(rest);
8031
+ return { calls: encodedCalls, ...encodedRest };
8032
+ },
8033
+ decode(p) {
8034
+ const { calls = [], ...rest } = p;
8035
+ const decodedCalls = calls.map(FunctionInvocationCodec.decode);
8036
+ const decodedRest = _FunctionInvocationCodec.decode(rest);
8037
+ return { ...decodedRest, calls: decodedCalls };
8038
+ }
8039
+ };
8040
+ const ExecuteInvocationSuccess = FunctionInvocationCodec;
8041
+ const ExecuteInvocationReverted = codec.MessageCodec({
8042
+ reason: codec.OptionalCodec(codec.StringCodec)
8086
8043
  });
8087
- const InvokeTransactionTrace = schema.Schema.Struct({
8088
- _tag: tag("invoke"),
8089
- invoke: schema.Schema.Struct({
8090
- validateInvocation: schema.Schema.optional(FunctionInvocation),
8091
- executeInvocation: schema.Schema.Union(
8092
- ExecuteInvocationReverted,
8093
- ExecuteInvocationSuccess
8094
- ),
8095
- feeTransferInvocation: schema.Schema.optional(FunctionInvocation)
8096
- })
8044
+ const InvokeTransactionTrace = codec.MessageCodec({
8045
+ validateInvocation: codec.OptionalCodec(FunctionInvocationCodec),
8046
+ executeInvocation: codec.RequiredCodec(
8047
+ codec.OneOfCodec({
8048
+ success: ExecuteInvocationSuccess,
8049
+ reverted: ExecuteInvocationReverted
8050
+ })
8051
+ ),
8052
+ feeTransferInvocation: codec.OptionalCodec(FunctionInvocationCodec)
8097
8053
  });
8098
- const DeclareTransactionTrace = schema.Schema.Struct({
8099
- _tag: tag("declare"),
8100
- declare: schema.Schema.Struct({
8101
- validateInvocation: schema.Schema.optional(FunctionInvocation),
8102
- feeTransferInvocation: schema.Schema.optional(FunctionInvocation)
8103
- })
8054
+ const DeclareTransactionTrace = codec.MessageCodec({
8055
+ validateInvocation: codec.OptionalCodec(FunctionInvocationCodec),
8056
+ feeTransferInvocation: codec.OptionalCodec(FunctionInvocationCodec)
8104
8057
  });
8105
- const DeployAccountTransactionTrace = schema.Schema.Struct({
8106
- _tag: tag("deployAccount"),
8107
- deployAccount: schema.Schema.Struct({
8108
- validateInvocation: schema.Schema.optional(FunctionInvocation),
8109
- constructorInvocation: schema.Schema.optional(FunctionInvocation),
8110
- feeTransferInvocation: schema.Schema.optional(FunctionInvocation)
8111
- })
8058
+ const DeployAccountTransactionTrace = codec.MessageCodec({
8059
+ validateInvocation: codec.OptionalCodec(FunctionInvocationCodec),
8060
+ constructorInvocation: codec.OptionalCodec(FunctionInvocationCodec),
8061
+ feeTransferInvocation: codec.OptionalCodec(FunctionInvocationCodec)
8112
8062
  });
8113
- const L1HandlerTransactionTrace = schema.Schema.Struct({
8114
- _tag: tag("l1Handler"),
8115
- l1Handler: schema.Schema.Struct({
8116
- functionInvocation: schema.Schema.optional(FunctionInvocation)
8117
- })
8063
+ const L1HandlerTransactionTrace = codec.MessageCodec({
8064
+ functionInvocation: codec.OptionalCodec(FunctionInvocationCodec)
8118
8065
  });
8119
- const TransactionTrace = schema.Schema.Struct({
8120
- filterIds: schema.Schema.Array(schema.Schema.Number),
8121
- transactionIndex: schema.Schema.Number,
8122
- transactionHash: FieldElement$1,
8123
- traceRoot: schema.Schema.Union(
8124
- InvokeTransactionTrace,
8125
- DeclareTransactionTrace,
8126
- DeployAccountTransactionTrace,
8127
- L1HandlerTransactionTrace
8066
+ const TransactionTrace = codec.MessageCodec({
8067
+ filterIds: codec.ArrayCodec(codec.NumberCodec),
8068
+ transactionIndex: codec.RequiredCodec(codec.NumberCodec),
8069
+ transactionHash: codec.RequiredCodec(FieldElement$1),
8070
+ traceRoot: codec.RequiredCodec(
8071
+ codec.OneOfCodec({
8072
+ invoke: InvokeTransactionTrace,
8073
+ declare: DeclareTransactionTrace,
8074
+ deployAccount: DeployAccountTransactionTrace,
8075
+ l1Handler: L1HandlerTransactionTrace
8076
+ })
8128
8077
  )
8129
8078
  });
8130
- const Block = schema.Schema.Struct({
8131
- header: BlockHeader,
8132
- transactions: schema.Schema.Array(Transaction),
8133
- receipts: schema.Schema.Array(TransactionReceipt),
8134
- events: schema.Schema.Array(Event),
8135
- messages: schema.Schema.Array(MessageToL1),
8136
- traces: schema.Schema.Array(TransactionTrace),
8137
- storageDiffs: schema.Schema.Array(StorageDiff),
8138
- contractChanges: schema.Schema.Array(ContractChange),
8139
- nonceUpdates: schema.Schema.Array(NonceUpdate)
8079
+ const Block = codec.MessageCodec({
8080
+ header: codec.RequiredCodec(BlockHeader),
8081
+ transactions: codec.ArrayCodec(Transaction),
8082
+ receipts: codec.ArrayCodec(TransactionReceipt),
8083
+ events: codec.ArrayCodec(Event),
8084
+ messages: codec.ArrayCodec(MessageToL1),
8085
+ traces: codec.ArrayCodec(TransactionTrace),
8086
+ storageDiffs: codec.ArrayCodec(StorageDiff),
8087
+ contractChanges: codec.ArrayCodec(ContractChange),
8088
+ nonceUpdates: codec.ArrayCodec(NonceUpdate)
8140
8089
  });
8141
- const BlockFromBytes = schema.Schema.transform(
8142
- schema.Schema.Uint8ArrayFromSelf,
8143
- schema.Schema.NullOr(Block),
8144
- {
8145
- strict: false,
8146
- decode(value) {
8147
- if (value.length === 0) {
8148
- return null;
8149
- }
8150
- return Block$1.decode(value);
8151
- },
8152
- encode(value) {
8153
- if (value === null) {
8154
- return new Uint8Array();
8155
- }
8156
- return Block$1.encode(value).finish();
8157
- }
8090
+ const BlockFromBytes = {
8091
+ encode(x) {
8092
+ const block = Block.encode(x);
8093
+ return Block$1.encode(block).finish();
8094
+ },
8095
+ decode(p) {
8096
+ const block = Block$1.decode(p);
8097
+ return Block.decode(block);
8158
8098
  }
8159
- );
8099
+ };
8160
8100
 
8161
- const HeaderFilter = schema.Schema.transform(
8162
- schema.Schema.Enums(HeaderFilter$1),
8163
- schema.Schema.Literal("always", "on_data", "on_data_or_on_new_block", "unknown"),
8164
- {
8165
- decode(value) {
8166
- const enumMap = {
8167
- [HeaderFilter$1.ALWAYS]: "always",
8168
- [HeaderFilter$1.ON_DATA]: "on_data",
8169
- [HeaderFilter$1.ON_DATA_OR_ON_NEW_BLOCK]: "on_data_or_on_new_block",
8170
- [HeaderFilter$1.UNSPECIFIED]: "unknown",
8171
- [HeaderFilter$1.UNRECOGNIZED]: "unknown"
8172
- };
8173
- return enumMap[value] ?? "unknown";
8174
- },
8175
- encode(value) {
8176
- switch (value) {
8177
- case "always":
8178
- return HeaderFilter$1.ALWAYS;
8179
- case "on_data":
8180
- return HeaderFilter$1.ON_DATA;
8181
- case "on_data_or_on_new_block":
8182
- return HeaderFilter$1.ON_DATA_OR_ON_NEW_BLOCK;
8183
- default:
8184
- return HeaderFilter$1.UNSPECIFIED;
8185
- }
8186
- }
8101
+ const HeaderFilter = {
8102
+ encode(x) {
8103
+ switch (x) {
8104
+ case "always":
8105
+ return HeaderFilter$1.ALWAYS;
8106
+ case "on_data":
8107
+ return HeaderFilter$1.ON_DATA;
8108
+ case "on_data_or_on_new_block":
8109
+ return HeaderFilter$1.ON_DATA_OR_ON_NEW_BLOCK;
8110
+ default:
8111
+ return HeaderFilter$1.UNSPECIFIED;
8112
+ }
8113
+ },
8114
+ decode(p) {
8115
+ const enumMap = {
8116
+ [HeaderFilter$1.ALWAYS]: "always",
8117
+ [HeaderFilter$1.ON_DATA]: "on_data",
8118
+ [HeaderFilter$1.ON_DATA_OR_ON_NEW_BLOCK]: "on_data_or_on_new_block",
8119
+ [HeaderFilter$1.UNSPECIFIED]: "unknown",
8120
+ [HeaderFilter$1.UNRECOGNIZED]: "unknown"
8121
+ };
8122
+ return enumMap[p] ?? "unknown";
8187
8123
  }
8188
- );
8189
- const Key = schema.Schema.transform(
8190
- schema.Schema.Struct({ value: schema.Schema.UndefinedOr(FieldElementProto) }),
8191
- schema.Schema.NullOr(FieldElement$1),
8192
- {
8193
- decode({ value }) {
8194
- if (value === void 0) {
8195
- return null;
8196
- }
8197
- return value;
8198
- },
8199
- encode(value) {
8200
- if (value === null) {
8201
- return { value: void 0 };
8202
- }
8203
- return { value };
8124
+ };
8125
+ const Key = {
8126
+ encode(x) {
8127
+ if (x === null) {
8128
+ return { value: void 0 };
8204
8129
  }
8205
- }
8206
- );
8207
- const TransactionStatusFilter = schema.Schema.transform(
8208
- schema.Schema.Enums(TransactionStatusFilter$1),
8209
- schema.Schema.Literal("succeeded", "reverted", "all", "unknown"),
8210
- {
8211
- decode(value) {
8212
- const enumMap = {
8213
- [TransactionStatusFilter$1.SUCCEEDED]: "succeeded",
8214
- [TransactionStatusFilter$1.REVERTED]: "reverted",
8215
- [TransactionStatusFilter$1.ALL]: "all",
8216
- [TransactionStatusFilter$1.UNSPECIFIED]: "unknown",
8217
- [TransactionStatusFilter$1.UNRECOGNIZED]: "unknown"
8218
- };
8219
- return enumMap[value] ?? "unknown";
8220
- },
8221
- encode(value) {
8222
- switch (value) {
8223
- case "succeeded":
8224
- return TransactionStatusFilter$1.SUCCEEDED;
8225
- case "reverted":
8226
- return TransactionStatusFilter$1.REVERTED;
8227
- case "all":
8228
- return TransactionStatusFilter$1.ALL;
8229
- default:
8230
- return TransactionStatusFilter$1.UNSPECIFIED;
8231
- }
8130
+ return { value: FieldElement$1.encode(x) };
8131
+ },
8132
+ decode(p) {
8133
+ if (p.value === void 0) {
8134
+ return null;
8232
8135
  }
8136
+ return FieldElement$1.decode(p.value);
8233
8137
  }
8234
- );
8235
- const EventFilter = schema.Schema.Struct({
8236
- id: schema.Schema.optional(schema.Schema.Number),
8237
- address: schema.Schema.optional(FieldElement$1),
8238
- keys: schema.Schema.optional(schema.Schema.Array(Key)),
8239
- strict: schema.Schema.optional(schema.Schema.Boolean),
8240
- transactionStatus: schema.Schema.optional(TransactionStatusFilter),
8241
- includeTransaction: schema.Schema.optional(schema.Schema.Boolean),
8242
- includeReceipt: schema.Schema.optional(schema.Schema.Boolean),
8243
- includeMessages: schema.Schema.optional(schema.Schema.Boolean),
8244
- includeSiblings: schema.Schema.optional(schema.Schema.Boolean),
8245
- includeTransactionTrace: schema.Schema.optional(schema.Schema.Boolean)
8246
- });
8247
- const MessageToL1Filter = schema.Schema.Struct({
8248
- id: schema.Schema.optional(schema.Schema.Number),
8249
- fromAddress: schema.Schema.optional(FieldElement$1),
8250
- toAddress: schema.Schema.optional(FieldElement$1),
8251
- transactionStatus: schema.Schema.optional(TransactionStatusFilter),
8252
- includeTransaction: schema.Schema.optional(schema.Schema.Boolean),
8253
- includeReceipt: schema.Schema.optional(schema.Schema.Boolean),
8254
- includeEvents: schema.Schema.optional(schema.Schema.Boolean),
8255
- includeTransactionTrace: schema.Schema.optional(schema.Schema.Boolean)
8256
- });
8257
- const InvokeTransactionV0Filter = schema.Schema.Struct({
8258
- _tag: tag("invokeV0"),
8259
- invokeV0: schema.Schema.Struct({})
8260
- });
8261
- const InvokeTransactionV1Filter = schema.Schema.Struct({
8262
- _tag: tag("invokeV1"),
8263
- invokeV1: schema.Schema.Struct({})
8264
- });
8265
- const InvokeTransactionV3Filter = schema.Schema.Struct({
8266
- _tag: tag("invokeV3"),
8267
- invokeV3: schema.Schema.Struct({})
8268
- });
8269
- const DeployTransactionFilter = schema.Schema.Struct({
8270
- _tag: tag("deploy"),
8271
- deploy: schema.Schema.Struct({})
8272
- });
8273
- const DeclareV0TransactionFilter = schema.Schema.Struct({
8274
- _tag: tag("declareV0"),
8275
- declareV0: schema.Schema.Struct({})
8276
- });
8277
- const DeclareV1TransactionFilter = schema.Schema.Struct({
8278
- _tag: tag("declareV1"),
8279
- declareV1: schema.Schema.Struct({})
8280
- });
8281
- const DeclareV2TransactionFilter = schema.Schema.Struct({
8282
- _tag: tag("declareV2"),
8283
- declareV2: schema.Schema.Struct({})
8284
- });
8285
- const DeclareV3TransactionFilter = schema.Schema.Struct({
8286
- _tag: tag("declareV3"),
8287
- declareV3: schema.Schema.Struct({})
8288
- });
8289
- const L1HandlerTransactionFilter = schema.Schema.Struct({
8290
- _tag: tag("l1Handler"),
8291
- l1Handler: schema.Schema.Struct({})
8292
- });
8293
- const DeployAccountV1TransactionFilter = schema.Schema.Struct({
8294
- _tag: tag("deployAccountV1"),
8295
- deployAccountV1: schema.Schema.Struct({})
8138
+ };
8139
+ const TransactionStatusFilter = {
8140
+ encode(x) {
8141
+ switch (x) {
8142
+ case "succeeded":
8143
+ return TransactionStatusFilter$1.SUCCEEDED;
8144
+ case "reverted":
8145
+ return TransactionStatusFilter$1.REVERTED;
8146
+ case "all":
8147
+ return TransactionStatusFilter$1.ALL;
8148
+ default:
8149
+ return TransactionStatusFilter$1.UNSPECIFIED;
8150
+ }
8151
+ },
8152
+ decode(p) {
8153
+ const enumMap = {
8154
+ [TransactionStatusFilter$1.SUCCEEDED]: "succeeded",
8155
+ [TransactionStatusFilter$1.REVERTED]: "reverted",
8156
+ [TransactionStatusFilter$1.ALL]: "all",
8157
+ [TransactionStatusFilter$1.UNSPECIFIED]: "unknown",
8158
+ [TransactionStatusFilter$1.UNRECOGNIZED]: "unknown"
8159
+ };
8160
+ return enumMap[p] ?? "unknown";
8161
+ }
8162
+ };
8163
+ const EventFilter = codec.MessageCodec({
8164
+ id: codec.OptionalCodec(codec.NumberCodec),
8165
+ address: codec.OptionalCodec(FieldElement$1),
8166
+ keys: codec.OptionalCodec(codec.ArrayCodec(Key)),
8167
+ strict: codec.OptionalCodec(codec.BooleanCodec),
8168
+ transactionStatus: codec.OptionalCodec(TransactionStatusFilter),
8169
+ includeTransaction: codec.OptionalCodec(codec.BooleanCodec),
8170
+ includeReceipt: codec.OptionalCodec(codec.BooleanCodec),
8171
+ includeMessages: codec.OptionalCodec(codec.BooleanCodec),
8172
+ includeSiblings: codec.OptionalCodec(codec.BooleanCodec),
8173
+ includeTransactionTrace: codec.OptionalCodec(codec.BooleanCodec)
8296
8174
  });
8297
- const DeployAccountV3TransactionFilter = schema.Schema.Struct({
8298
- _tag: tag("deployAccountV3"),
8299
- deployAccountV3: schema.Schema.Struct({})
8175
+ const MessageToL1Filter = codec.MessageCodec({
8176
+ id: codec.OptionalCodec(codec.NumberCodec),
8177
+ fromAddress: codec.OptionalCodec(FieldElement$1),
8178
+ toAddress: codec.OptionalCodec(FieldElement$1),
8179
+ transactionStatus: codec.OptionalCodec(TransactionStatusFilter),
8180
+ includeTransaction: codec.OptionalCodec(codec.BooleanCodec),
8181
+ includeReceipt: codec.OptionalCodec(codec.BooleanCodec),
8182
+ includeEvents: codec.OptionalCodec(codec.BooleanCodec),
8183
+ includeTransactionTrace: codec.OptionalCodec(codec.BooleanCodec)
8300
8184
  });
8301
- const TransactionFilter = schema.Schema.Struct({
8302
- id: schema.Schema.optional(schema.Schema.Number),
8303
- transactionStatus: schema.Schema.optional(TransactionStatusFilter),
8304
- includeReceipt: schema.Schema.optional(schema.Schema.Boolean),
8305
- includeMessages: schema.Schema.optional(schema.Schema.Boolean),
8306
- includeEvents: schema.Schema.optional(schema.Schema.Boolean),
8307
- includeTrace: schema.Schema.optional(schema.Schema.Boolean),
8308
- transactionType: schema.Schema.optional(
8309
- schema.Schema.Union(
8310
- InvokeTransactionV0Filter,
8311
- InvokeTransactionV1Filter,
8312
- InvokeTransactionV3Filter,
8313
- DeployTransactionFilter,
8314
- DeclareV0TransactionFilter,
8315
- DeclareV1TransactionFilter,
8316
- DeclareV2TransactionFilter,
8317
- DeclareV3TransactionFilter,
8318
- DeclareV3TransactionFilter,
8319
- L1HandlerTransactionFilter,
8320
- DeployAccountV1TransactionFilter,
8321
- DeployAccountV3TransactionFilter
8322
- )
8185
+ const InvokeTransactionV0Filter = codec.MessageCodec({});
8186
+ const InvokeTransactionV1Filter = codec.MessageCodec({});
8187
+ const InvokeTransactionV3Filter = codec.MessageCodec({});
8188
+ const DeployTransactionFilter = codec.MessageCodec({});
8189
+ const DeclareV0TransactionFilter = codec.MessageCodec({});
8190
+ const DeclareV1TransactionFilter = codec.MessageCodec({});
8191
+ const DeclareV2TransactionFilter = codec.MessageCodec({});
8192
+ const DeclareV3TransactionFilter = codec.MessageCodec({});
8193
+ const L1HandlerTransactionFilter = codec.MessageCodec({});
8194
+ const DeployAccountV1TransactionFilter = codec.MessageCodec({});
8195
+ const DeployAccountV3TransactionFilter = codec.MessageCodec({});
8196
+ const TransactionFilter = codec.MessageCodec({
8197
+ id: codec.OptionalCodec(codec.NumberCodec),
8198
+ transactionStatus: codec.OptionalCodec(TransactionStatusFilter),
8199
+ includeReceipt: codec.OptionalCodec(codec.BooleanCodec),
8200
+ includeMessages: codec.OptionalCodec(codec.BooleanCodec),
8201
+ includeEvents: codec.OptionalCodec(codec.BooleanCodec),
8202
+ includeTrace: codec.OptionalCodec(codec.BooleanCodec),
8203
+ transactionType: codec.OptionalCodec(
8204
+ codec.OneOfCodec({
8205
+ invokeV0: InvokeTransactionV0Filter,
8206
+ invokeV1: InvokeTransactionV1Filter,
8207
+ invokeV3: InvokeTransactionV3Filter,
8208
+ deploy: DeployTransactionFilter,
8209
+ declareV0: DeclareV0TransactionFilter,
8210
+ declareV1: DeclareV1TransactionFilter,
8211
+ declareV2: DeclareV2TransactionFilter,
8212
+ declareV3: DeclareV3TransactionFilter,
8213
+ l1Handler: L1HandlerTransactionFilter,
8214
+ deployAccountV1: DeployAccountV1TransactionFilter,
8215
+ deployAccountV3: DeployAccountV3TransactionFilter
8216
+ })
8323
8217
  )
8324
8218
  });
8325
- const StorageDiffFilter = schema.Schema.Struct({
8326
- id: schema.Schema.optional(schema.Schema.Number),
8327
- contractAddress: schema.Schema.optional(FieldElement$1)
8328
- });
8329
- const DeclaredClassFilter = schema.Schema.Struct({
8330
- _tag: tag("declaredClass"),
8331
- declaredClass: schema.Schema.Struct({})
8219
+ const StorageDiffFilter = codec.MessageCodec({
8220
+ id: codec.OptionalCodec(codec.NumberCodec),
8221
+ contractAddress: codec.OptionalCodec(FieldElement$1)
8332
8222
  });
8333
- const ReplacedClassFilter = schema.Schema.Struct({
8334
- _tag: tag("replacedClass"),
8335
- replacedClass: schema.Schema.Struct({})
8336
- });
8337
- const DeployedContractFilter = schema.Schema.Struct({
8338
- _tag: tag("deployedContract"),
8339
- deployedContract: schema.Schema.Struct({})
8340
- });
8341
- const ContractChangeFilter = schema.Schema.Struct({
8342
- id: schema.Schema.optional(schema.Schema.Number),
8343
- change: schema.Schema.optional(
8344
- schema.Schema.Union(
8345
- DeclaredClassFilter,
8346
- ReplacedClassFilter,
8347
- DeployedContractFilter
8348
- )
8223
+ const DeclaredClassFilter = codec.MessageCodec({});
8224
+ const ReplacedClassFilter = codec.MessageCodec({});
8225
+ const DeployedContractFilter = codec.MessageCodec({});
8226
+ const ContractChangeFilter = codec.MessageCodec({
8227
+ id: codec.OptionalCodec(codec.NumberCodec),
8228
+ change: codec.OptionalCodec(
8229
+ codec.OneOfCodec({
8230
+ declaredClass: DeclaredClassFilter,
8231
+ replacedClass: ReplacedClassFilter,
8232
+ deployedContract: DeployedContractFilter
8233
+ })
8349
8234
  )
8350
8235
  });
8351
- const NonceUpdateFilter = schema.Schema.Struct({
8352
- id: schema.Schema.optional(schema.Schema.Number),
8353
- contractAddress: schema.Schema.optional(FieldElement$1)
8236
+ const NonceUpdateFilter = codec.MessageCodec({
8237
+ id: codec.OptionalCodec(codec.NumberCodec),
8238
+ contractAddress: codec.OptionalCodec(FieldElement$1)
8354
8239
  });
8355
- const Filter = schema.Schema.Struct({
8356
- header: schema.Schema.optional(HeaderFilter),
8357
- transactions: schema.Schema.optional(schema.Schema.Array(TransactionFilter)),
8358
- events: schema.Schema.optional(schema.Schema.Array(EventFilter)),
8359
- messages: schema.Schema.optional(schema.Schema.Array(MessageToL1Filter)),
8360
- storageDiffs: schema.Schema.optional(schema.Schema.Array(StorageDiffFilter)),
8361
- contractChanges: schema.Schema.optional(schema.Schema.Array(ContractChangeFilter)),
8362
- nonceUpdates: schema.Schema.optional(schema.Schema.Array(NonceUpdateFilter))
8240
+ const Filter = codec.MessageCodec({
8241
+ header: codec.OptionalCodec(HeaderFilter),
8242
+ transactions: codec.OptionalCodec(codec.ArrayCodec(TransactionFilter)),
8243
+ events: codec.OptionalCodec(codec.ArrayCodec(EventFilter)),
8244
+ messages: codec.OptionalCodec(codec.ArrayCodec(MessageToL1Filter)),
8245
+ storageDiffs: codec.OptionalCodec(codec.ArrayCodec(StorageDiffFilter)),
8246
+ contractChanges: codec.OptionalCodec(codec.ArrayCodec(ContractChangeFilter)),
8247
+ nonceUpdates: codec.OptionalCodec(codec.ArrayCodec(NonceUpdateFilter))
8363
8248
  });
8364
- const filterToProto = schema.Schema.encodeSync(Filter);
8365
- const filterFromProto = schema.Schema.decodeSync(Filter);
8366
- const FilterFromBytes = schema.Schema.transform(
8367
- schema.Schema.Uint8ArrayFromSelf,
8368
- Filter,
8369
- {
8370
- strict: false,
8371
- decode(value) {
8372
- return Filter$1.decode(value);
8373
- },
8374
- encode(value) {
8375
- return Filter$1.encode(value).finish();
8376
- }
8249
+ const FilterFromBytes = {
8250
+ encode(x) {
8251
+ const filter = Filter.encode(x);
8252
+ return Filter$1.encode(filter).finish();
8253
+ },
8254
+ decode(p) {
8255
+ const filter = Filter$1.decode(p);
8256
+ return Filter.decode(filter);
8377
8257
  }
8378
- );
8379
- const filterToBytes = schema.Schema.encodeSync(FilterFromBytes);
8380
- const filterFromBytes = schema.Schema.decodeSync(FilterFromBytes);
8258
+ };
8381
8259
  function mergeFilter(a, b) {
8382
8260
  const header = mergeHeaderFilter(a.header, b.header);
8383
8261
  return {
@@ -8642,10 +8520,8 @@ exports.ExecutionReverted = ExecutionReverted;
8642
8520
  exports.ExecutionSucceeded = ExecutionSucceeded;
8643
8521
  exports.FeePayment = FeePayment;
8644
8522
  exports.FieldElement = FieldElement$1;
8645
- exports.FieldElementProto = FieldElementProto;
8646
8523
  exports.Filter = Filter;
8647
8524
  exports.FilterFromBytes = FilterFromBytes;
8648
- exports.FunctionInvocation = FunctionInvocation;
8649
8525
  exports.HeaderFilter = HeaderFilter;
8650
8526
  exports.InvokeTransactionReceipt = InvokeTransactionReceipt;
8651
8527
  exports.InvokeTransactionTrace = InvokeTransactionTrace;
@@ -8685,12 +8561,6 @@ exports.TransactionStatusFilter = TransactionStatusFilter;
8685
8561
  exports.TransactionTrace = TransactionTrace;
8686
8562
  exports.U128 = U128;
8687
8563
  exports.decodeEvent = decodeEvent;
8688
- exports.feltFromProto = feltFromProto;
8689
- exports.feltToProto = feltToProto;
8690
- exports.filterFromBytes = filterFromBytes;
8691
- exports.filterFromProto = filterFromProto;
8692
- exports.filterToBytes = filterToBytes;
8693
- exports.filterToProto = filterToProto;
8694
8564
  exports.getBigIntSelector = getBigIntSelector;
8695
8565
  exports.getEventSelector = getEventSelector;
8696
8566
  exports.getReceipt = getReceipt;