@apibara/starknet 2.1.0-beta.13 → 2.1.0-beta.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apibara/starknet",
3
- "version": "2.1.0-beta.13",
3
+ "version": "2.1.0-beta.14",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -42,7 +42,7 @@
42
42
  "vitest": "^1.6.0"
43
43
  },
44
44
  "dependencies": {
45
- "@apibara/protocol": "2.1.0-beta.13",
45
+ "@apibara/protocol": "2.1.0-beta.14",
46
46
  "@effect/schema": "^0.67.15",
47
47
  "@scure/starknet": "^1.1.0",
48
48
  "abi-wan-kanabi": "^2.2.4",
package/src/block.ts CHANGED
@@ -14,6 +14,8 @@ export const ResourcePrice = Schema.Struct({
14
14
  priceInWei: Schema.optional(FieldElement),
15
15
  });
16
16
 
17
+ export type ResourcePrice = typeof ResourcePrice.Type;
18
+
17
19
  /** How data is posted to L1. */
18
20
  export const L1DataAvailabilityMode = Schema.transform(
19
21
  Schema.Enums(proto.data.L1DataAvailabilityMode),
@@ -35,6 +37,8 @@ export const L1DataAvailabilityMode = Schema.transform(
35
37
  },
36
38
  );
37
39
 
40
+ export type L1DataAvailabilityMode = typeof L1DataAvailabilityMode.Type;
41
+
38
42
  export const TransactionStatus = Schema.transform(
39
43
  Schema.Enums(proto.data.TransactionStatus),
40
44
  Schema.Literal("unknown", "succeeded", "reverted"),
@@ -75,16 +79,22 @@ export const U128 = Schema.transform(
75
79
  },
76
80
  );
77
81
 
82
+ export type U128 = typeof U128.Type;
83
+
78
84
  export const ResourceBounds = Schema.Struct({
79
85
  maxAmount: Schema.BigIntFromSelf,
80
86
  maxPricePerUnit: U128,
81
87
  });
82
88
 
89
+ export type ResourceBounds = typeof ResourceBounds.Type;
90
+
83
91
  export const ResourceBoundsMapping = Schema.Struct({
84
92
  l1Gas: ResourceBounds,
85
93
  l2Gas: ResourceBounds,
86
94
  });
87
95
 
96
+ export type ResourceBoundsMapping = typeof ResourceBoundsMapping.Type;
97
+
88
98
  export const DataAvailabilityMode = Schema.transform(
89
99
  Schema.Enums(proto.data.DataAvailabilityMode),
90
100
  Schema.Literal("l1", "l2", "unknown"),
@@ -105,6 +115,8 @@ export const DataAvailabilityMode = Schema.transform(
105
115
  },
106
116
  );
107
117
 
118
+ export type DataAvailabilityMode = typeof DataAvailabilityMode.Type;
119
+
108
120
  /** Starknet block header.
109
121
  *
110
122
  * @prop blockHash The hash of the block.
@@ -160,6 +172,8 @@ export const InvokeTransactionV0 = Schema.Struct({
160
172
  }),
161
173
  });
162
174
 
175
+ export type InvokeTransactionV0 = typeof InvokeTransactionV0.Type;
176
+
163
177
  export const InvokeTransactionV1 = Schema.Struct({
164
178
  _tag: tag("invokeV1"),
165
179
  invokeV1: Schema.Struct({
@@ -171,6 +185,8 @@ export const InvokeTransactionV1 = Schema.Struct({
171
185
  }),
172
186
  });
173
187
 
188
+ export type InvokeTransactionV1 = typeof InvokeTransactionV1.Type;
189
+
174
190
  export const InvokeTransactionV3 = Schema.Struct({
175
191
  _tag: tag("invokeV3"),
176
192
  invokeV3: Schema.Struct({
@@ -187,6 +203,8 @@ export const InvokeTransactionV3 = Schema.Struct({
187
203
  }),
188
204
  });
189
205
 
206
+ export type InvokeTransactionV3 = typeof InvokeTransactionV3.Type;
207
+
190
208
  export const L1HandlerTransaction = Schema.Struct({
191
209
  _tag: tag("l1Handler"),
192
210
  l1Handler: Schema.Struct({
@@ -197,6 +215,8 @@ export const L1HandlerTransaction = Schema.Struct({
197
215
  }),
198
216
  });
199
217
 
218
+ export type L1HandlerTransaction = typeof L1HandlerTransaction.Type;
219
+
200
220
  export const DeployTransaction = Schema.Struct({
201
221
  _tag: tag("deploy"),
202
222
  deploy: Schema.Struct({
@@ -206,6 +226,8 @@ export const DeployTransaction = Schema.Struct({
206
226
  }),
207
227
  });
208
228
 
229
+ export type DeployTransaction = typeof DeployTransaction.Type;
230
+
209
231
  export const DeclareTransactionV0 = Schema.Struct({
210
232
  _tag: tag("declareV0"),
211
233
  declareV0: Schema.Struct({
@@ -216,6 +238,8 @@ export const DeclareTransactionV0 = Schema.Struct({
216
238
  }),
217
239
  });
218
240
 
241
+ export type DeclareTransactionV0 = typeof DeclareTransactionV0.Type;
242
+
219
243
  export const DeclareTransactionV1 = Schema.Struct({
220
244
  _tag: tag("declareV1"),
221
245
  declareV1: Schema.Struct({
@@ -227,6 +251,8 @@ export const DeclareTransactionV1 = Schema.Struct({
227
251
  }),
228
252
  });
229
253
 
254
+ export type DeclareTransactionV1 = typeof DeclareTransactionV1.Type;
255
+
230
256
  export const DeclareTransactionV2 = Schema.Struct({
231
257
  _tag: tag("declareV2"),
232
258
  declareV2: Schema.Struct({
@@ -239,6 +265,8 @@ export const DeclareTransactionV2 = Schema.Struct({
239
265
  }),
240
266
  });
241
267
 
268
+ export type DeclareTransactionV2 = typeof DeclareTransactionV2.Type;
269
+
242
270
  export const DeclareTransactionV3 = Schema.Struct({
243
271
  _tag: tag("declareV3"),
244
272
  declareV3: Schema.Struct({
@@ -256,6 +284,8 @@ export const DeclareTransactionV3 = Schema.Struct({
256
284
  }),
257
285
  });
258
286
 
287
+ export type DeclareTransactionV3 = typeof DeclareTransactionV3.Type;
288
+
259
289
  export const DeployAccountTransactionV1 = Schema.Struct({
260
290
  _tag: tag("deployAccountV1"),
261
291
  deployAccountV1: Schema.Struct({
@@ -268,6 +298,8 @@ export const DeployAccountTransactionV1 = Schema.Struct({
268
298
  }),
269
299
  });
270
300
 
301
+ export type DeployAccountTransactionV1 = typeof DeployAccountTransactionV1.Type;
302
+
271
303
  export const DeployAccountTransactionV3 = Schema.Struct({
272
304
  _tag: tag("deployAccountV3"),
273
305
  deployAccountV3: Schema.Struct({
@@ -284,6 +316,8 @@ export const DeployAccountTransactionV3 = Schema.Struct({
284
316
  }),
285
317
  });
286
318
 
319
+ export type DeployAccountTransactionV3 = typeof DeployAccountTransactionV3.Type;
320
+
287
321
  /** A transaction.
288
322
  *
289
323
  * @prop meta Transaction metadata.
@@ -328,11 +362,15 @@ export const PriceUnit = Schema.transform(
328
362
  },
329
363
  );
330
364
 
365
+ export type PriceUnit = typeof PriceUnit.Type;
366
+
331
367
  export const FeePayment = Schema.Struct({
332
368
  amount: FieldElement,
333
369
  unit: PriceUnit,
334
370
  });
335
371
 
372
+ export type FeePayment = typeof FeePayment.Type;
373
+
336
374
  export const ComputationResources = Schema.Struct({
337
375
  steps: Schema.BigIntFromSelf,
338
376
  memoryHoles: Schema.optional(Schema.BigIntFromSelf),
@@ -346,21 +384,29 @@ export const ComputationResources = Schema.Struct({
346
384
  segmentArenaBuiltin: Schema.optional(Schema.BigIntFromSelf),
347
385
  });
348
386
 
387
+ export type ComputationResources = typeof ComputationResources.Type;
388
+
349
389
  export const DataAvailabilityResources = Schema.Struct({
350
390
  l1Gas: Schema.BigIntFromSelf,
351
391
  l1DataGas: Schema.BigIntFromSelf,
352
392
  });
353
393
 
394
+ export type DataAvailabilityResources = typeof DataAvailabilityResources.Type;
395
+
354
396
  export const ExecutionResources = Schema.Struct({
355
397
  computation: ComputationResources,
356
398
  dataAvailability: DataAvailabilityResources,
357
399
  });
358
400
 
401
+ export type ExecutionResources = typeof ExecutionResources.Type;
402
+
359
403
  export const ExecutionSucceeded = Schema.Struct({
360
404
  _tag: tag("succeeded"),
361
405
  succeeded: Schema.Struct({}),
362
406
  });
363
407
 
408
+ export type ExecutionSucceeded = typeof ExecutionSucceeded.Type;
409
+
364
410
  export const ExecutionReverted = Schema.Struct({
365
411
  _tag: tag("reverted"),
366
412
  reverted: Schema.Struct({
@@ -368,6 +414,8 @@ export const ExecutionReverted = Schema.Struct({
368
414
  }),
369
415
  });
370
416
 
417
+ export type ExecutionReverted = typeof ExecutionReverted.Type;
418
+
371
419
  /** Common fields for all transaction receipts. */
372
420
  export const TransactionReceiptMeta = Schema.Struct({
373
421
  transactionIndex: Schema.Number,
@@ -377,11 +425,15 @@ export const TransactionReceiptMeta = Schema.Struct({
377
425
  executionResult: Schema.Union(ExecutionSucceeded, ExecutionReverted),
378
426
  });
379
427
 
428
+ export type TransactionReceiptMeta = typeof TransactionReceiptMeta.Type;
429
+
380
430
  export const InvokeTransactionReceipt = Schema.Struct({
381
431
  _tag: tag("invoke"),
382
432
  invoke: Schema.Struct({}),
383
433
  });
384
434
 
435
+ export type InvokeTransactionReceipt = typeof InvokeTransactionReceipt.Type;
436
+
385
437
  export const L1HandlerTransactionReceipt = Schema.Struct({
386
438
  _tag: tag("l1Handler"),
387
439
  l1Handler: Schema.Struct({
@@ -389,11 +441,16 @@ export const L1HandlerTransactionReceipt = Schema.Struct({
389
441
  }),
390
442
  });
391
443
 
444
+ export type L1HandlerTransactionReceipt =
445
+ typeof L1HandlerTransactionReceipt.Type;
446
+
392
447
  export const DeclareTransactionReceipt = Schema.Struct({
393
448
  _tag: tag("declare"),
394
449
  declare: Schema.Struct({}),
395
450
  });
396
451
 
452
+ export type DeclareTransactionReceipt = typeof DeclareTransactionReceipt.Type;
453
+
397
454
  export const DeployTransactionReceipt = Schema.Struct({
398
455
  _tag: tag("deploy"),
399
456
  deploy: Schema.Struct({
@@ -401,6 +458,8 @@ export const DeployTransactionReceipt = Schema.Struct({
401
458
  }),
402
459
  });
403
460
 
461
+ export type DeployTransactionReceipt = typeof DeployTransactionReceipt.Type;
462
+
404
463
  export const DeployAccountTransactionReceipt = Schema.Struct({
405
464
  _tag: tag("deployAccount"),
406
465
  deployAccount: Schema.Struct({
@@ -408,6 +467,9 @@ export const DeployAccountTransactionReceipt = Schema.Struct({
408
467
  }),
409
468
  });
410
469
 
470
+ export type DeployAccountTransactionReceipt =
471
+ typeof DeployAccountTransactionReceipt.Type;
472
+
411
473
  /** A transaction receipt.
412
474
  *
413
475
  * @prop meta Transaction receipt metadata.
package/src/filter.ts CHANGED
@@ -147,56 +147,80 @@ export const InvokeTransactionV0Filter = Schema.Struct({
147
147
  invokeV0: Schema.Struct({}),
148
148
  });
149
149
 
150
+ export type InvokeTransactionV0Filter = typeof InvokeTransactionV0Filter.Type;
151
+
150
152
  export const InvokeTransactionV1Filter = Schema.Struct({
151
153
  _tag: tag("invokeV1"),
152
154
  invokeV1: Schema.Struct({}),
153
155
  });
154
156
 
157
+ export type InvokeTransactionV1Filter = typeof InvokeTransactionV1Filter.Type;
158
+
155
159
  export const InvokeTransactionV3Filter = Schema.Struct({
156
160
  _tag: tag("invokeV3"),
157
161
  invokeV3: Schema.Struct({}),
158
162
  });
159
163
 
164
+ export type InvokeTransactionV3Filter = typeof InvokeTransactionV3Filter.Type;
165
+
160
166
  export const DeployTransactionFilter = Schema.Struct({
161
167
  _tag: tag("deploy"),
162
168
  deploy: Schema.Struct({}),
163
169
  });
164
170
 
171
+ export type DeployTransactionFilter = typeof DeployTransactionFilter.Type;
172
+
165
173
  export const DeclareV0TransactionFilter = Schema.Struct({
166
174
  _tag: tag("declareV0"),
167
175
  declareV0: Schema.Struct({}),
168
176
  });
169
177
 
178
+ export type DeclareV0TransactionFilter = typeof DeclareV0TransactionFilter.Type;
179
+
170
180
  export const DeclareV1TransactionFilter = Schema.Struct({
171
181
  _tag: tag("declareV1"),
172
182
  declareV1: Schema.Struct({}),
173
183
  });
174
184
 
185
+ export type DeclareV1TransactionFilter = typeof DeclareV1TransactionFilter.Type;
186
+
175
187
  export const DeclareV2TransactionFilter = Schema.Struct({
176
188
  _tag: tag("declareV2"),
177
189
  declareV2: Schema.Struct({}),
178
190
  });
179
191
 
192
+ export type DeclareV2TransactionFilter = typeof DeclareV2TransactionFilter.Type;
193
+
180
194
  export const DeclareV3TransactionFilter = Schema.Struct({
181
195
  _tag: tag("declareV3"),
182
196
  declareV3: Schema.Struct({}),
183
197
  });
184
198
 
199
+ export type DeclareV3TransactionFilter = typeof DeclareV3TransactionFilter.Type;
200
+
185
201
  export const L1HandlerTransactionFilter = Schema.Struct({
186
202
  _tag: tag("l1Handler"),
187
203
  l1Handler: Schema.Struct({}),
188
204
  });
189
205
 
206
+ export type L1HandlerTransactionFilter = typeof L1HandlerTransactionFilter.Type;
207
+
190
208
  export const DeployAccountV1TransactionFilter = Schema.Struct({
191
209
  _tag: tag("deployAccountV1"),
192
210
  deployAccountV1: Schema.Struct({}),
193
211
  });
194
212
 
213
+ export type DeployAccountV1TransactionFilter =
214
+ typeof DeployAccountV1TransactionFilter.Type;
215
+
195
216
  export const DeployAccountV3TransactionFilter = Schema.Struct({
196
217
  _tag: tag("deployAccountV3"),
197
218
  deployAccountV3: Schema.Struct({}),
198
219
  });
199
220
 
221
+ export type DeployAccountV3TransactionFilter =
222
+ typeof DeployAccountV3TransactionFilter.Type;
223
+
200
224
  /** Filter transactions.
201
225
  *
202
226
  * @prop transactionStatus Filter based on the transaction status.
@@ -275,6 +299,8 @@ export const ContractChangeFilter = Schema.Struct({
275
299
  ),
276
300
  });
277
301
 
302
+ export type ContractChangeFilter = typeof ContractChangeFilter.Type;
303
+
278
304
  /** Filter updates to nonces.
279
305
  *
280
306
  * @prop contractAddress Filter by contract address.
@@ -284,6 +310,8 @@ export const NonceUpdateFilter = Schema.Struct({
284
310
  contractAddress: Schema.optional(FieldElement),
285
311
  });
286
312
 
313
+ export type NonceUpdateFilter = typeof NonceUpdateFilter.Type;
314
+
287
315
  export const Filter = Schema.Struct({
288
316
  header: Schema.optional(HeaderFilter),
289
317
  transactions: Schema.optional(Schema.Array(TransactionFilter)),