@apibara/indexer 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/starknet/block.d.ts +53 -3
- package/dist/starknet/filter.d.ts +1 -1
- package/dist/starknet/index.d.ts +1 -1
- package/dist/starknet/parser.d.ts +3 -3
- package/dist/starknet/parser.js.map +1 -1
- package/package.json +1 -1
- package/src/config.test-d.ts +1 -1
- package/src/sink/console.test-d.ts +1 -1
- package/src/starknet/block.test-d.ts +1 -1
- package/src/starknet/block.ts +65 -3
- package/src/starknet/filter.test-d.ts +1 -1
- package/src/starknet/filter.ts +1 -1
- package/src/starknet/index.ts +1 -1
- package/src/starknet/parser.test.ts +1 -1
- package/src/starknet/parser.ts +3 -3
package/dist/starknet/block.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldElement } from "./felt";
|
|
1
|
+
import type { FieldElement } from "./felt";
|
|
2
2
|
export type Block = Partial<{
|
|
3
3
|
/** Block header. */
|
|
4
4
|
header: BlockHeader;
|
|
@@ -25,7 +25,11 @@ export type BlockHeader = Partial<{
|
|
|
25
25
|
/** Block production timestamp. */
|
|
26
26
|
timestamp: string;
|
|
27
27
|
/** Price of L1 gas in the block. */
|
|
28
|
-
l1GasPrice
|
|
28
|
+
l1GasPrice?: ResourcePrice;
|
|
29
|
+
/** Price of L1 data gas in the block. */
|
|
30
|
+
l1DataGasPrice?: ResourcePrice;
|
|
31
|
+
/** L1 data availability mode. */
|
|
32
|
+
l1DataAvailabilityMode?: L1DataAvailabilityMode;
|
|
29
33
|
}>;
|
|
30
34
|
export type TransactionWithReceipt = {
|
|
31
35
|
/** Transaction. */
|
|
@@ -252,9 +256,54 @@ export type TransactionReceipt = Partial<{
|
|
|
252
256
|
/** Events. */
|
|
253
257
|
events: Event[];
|
|
254
258
|
/** Revert reason. */
|
|
255
|
-
revertReason
|
|
259
|
+
revertReason: string;
|
|
260
|
+
/** Fee paid. */
|
|
261
|
+
actualFeePaid: FeePayment;
|
|
262
|
+
/** Resources consumed by the transaction. */
|
|
263
|
+
executionResources: ExecutionResources;
|
|
256
264
|
}>;
|
|
257
265
|
export type ExecutionStatus = "EXECUTION_STATUS_UNSPECIFIED" | "EXECUTION_STATUS_SUCCEEDED" | "EXECUTION_STATUS_REVERTED";
|
|
266
|
+
export type FeePayment = Partial<{
|
|
267
|
+
/** Amount paid. */
|
|
268
|
+
amount: FieldElement;
|
|
269
|
+
/** Unit of the amount. */
|
|
270
|
+
unit: PriceUnit;
|
|
271
|
+
}>;
|
|
272
|
+
export type ExecutionResources = Partial<{
|
|
273
|
+
/** Computation resources. */
|
|
274
|
+
computation: ComputationResources;
|
|
275
|
+
/** Data availability resources. */
|
|
276
|
+
dataAvailability: DataAvailabilityResources;
|
|
277
|
+
}>;
|
|
278
|
+
export type ComputationResources = Partial<{
|
|
279
|
+
/** The gas consumed by this transaction's data, 0 if it uses data gas for DA. */
|
|
280
|
+
l1Gas: number;
|
|
281
|
+
/** The data gas consumed by this transaction's data, 0 if it uses gas for DA. */
|
|
282
|
+
l1DataGas: number;
|
|
283
|
+
}>;
|
|
284
|
+
export type DataAvailabilityResources = Partial<{
|
|
285
|
+
/** The number of Cairo steps used. */
|
|
286
|
+
steps: number;
|
|
287
|
+
/** The number of unused memory cells. */
|
|
288
|
+
memoryHoles: number;
|
|
289
|
+
/** The number of RANGE_CHECK builtin instances. */
|
|
290
|
+
rangeCheckBuiltinApplications: number;
|
|
291
|
+
/** The number of Pedersen builtin instances. */
|
|
292
|
+
pedersenBuiltinApplications: number;
|
|
293
|
+
/** The number of Poseidon builtin instances. */
|
|
294
|
+
poseidonBuiltinApplications: number;
|
|
295
|
+
/** The number of EC_OP builtin instances. */
|
|
296
|
+
ecOpBuiltinApplications: number;
|
|
297
|
+
/** The number of ECDSA builtin instances. */
|
|
298
|
+
ecdsaBuiltinApplications: number;
|
|
299
|
+
/** The number of BITWISE builtin instances. */
|
|
300
|
+
bitwiseBuiltinApplications: number;
|
|
301
|
+
/** The number of KECCAK builtin instances. */
|
|
302
|
+
keccakBuiltinApplications: number;
|
|
303
|
+
/** The number of accesses to the segment arena. */
|
|
304
|
+
segmentArenaBuiltin: number;
|
|
305
|
+
}>;
|
|
306
|
+
export type PriceUnit = "PRICE_UNIT_UNSPECIFIED" | "PRICE_UNIT_FRI" | "PRICE_UNIT_WEI";
|
|
258
307
|
export type Event = Partial<{
|
|
259
308
|
/** Event index. */
|
|
260
309
|
index: number;
|
|
@@ -355,3 +404,4 @@ export type ResourceBounds = Partial<{
|
|
|
355
404
|
}>;
|
|
356
405
|
}>;
|
|
357
406
|
export type DataAvailabilityMode = "DATA_AVAILABILITY_MODE_UNSPECIFIED" | "DATA_AVAILABILITY_MODE_L2" | "DATA_AVAILABILITY_MODE_L1";
|
|
407
|
+
export type L1DataAvailabilityMode = "L1_DATA_AVAILABILITY_MODE_UNSPECIFIED" | "L1_DATA_AVAILABILITY_MODE_BLOB" | "L1_DATA_AVAILABILITY_MODE_CALLDATA";
|
package/dist/starknet/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export * from "./filter";
|
|
|
2
2
|
export * from "./block";
|
|
3
3
|
export { FieldElement, getSelector } from "./felt";
|
|
4
4
|
export { Contract } from "./parser";
|
|
5
|
-
import { Filter } from "./filter";
|
|
5
|
+
import type { Filter } from "./filter";
|
|
6
6
|
/** Starknet network type and data filter. */
|
|
7
7
|
export type Starknet = {
|
|
8
8
|
network: "starknet";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FieldElement } from "./felt";
|
|
3
|
-
import { EventFilter } from "./filter";
|
|
1
|
+
import type { Abi } from "starknet";
|
|
2
|
+
import { type FieldElement } from "./felt";
|
|
3
|
+
import type { EventFilter } from "./filter";
|
|
4
4
|
/** Build a stream filter from a contract ABI. */
|
|
5
5
|
export declare class Contract {
|
|
6
6
|
readonly address: FieldElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/starknet/parser.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/starknet/parser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,WAAW,EAAE,MAAM,QAAQ,CAAC;AAGxD,iDAAiD;AACjD,MAAM,OAAO,QAAQ;IACnB,+DAA+D;IACtD,OAAO,CAAe;IACtB,GAAG,CAAM;IAEV,eAAe,CAA+B;IAEtD,YAAY,eAA6B,EAAE,WAAgB;QACzD,IAAI,CAAC,OAAO,GAAG,eAAe,CAAC;QAC/B,IAAI,CAAC,GAAG,GAAG,WAAW,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,wBAAwB,EAAE,CAAC;IAClC,CAAC;IAEO,UAAU,CAAC,IAAY;QAC7B,wDAAwD;QACxD,MAAM,KAAK,GAAyB,IAAI,CAAC,GAAG,CAAC,IAAI,CAC/C,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CACtD,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,wBAAwB;QAC9B,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,GAAG,EAAE;YAC5B,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;gBAC1B,SAAS;aACV;YACD,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;SAC5D;IACH,CAAC;IAED,iEAAiE;IACjE,WAAW,CACT,IAAY,EACZ,OAGI,EAAE;QAEN,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAEpC,sDAAsD;QACtD,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,4BAA4B,CAAC,CAAC;SAC5D;QAED,0BAA0B;QAC1B,OAAO;YACL,WAAW,EAAE,IAAI,CAAC,OAAO;YACzB,IAAI,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC/B,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,IAAI,KAAK;YACpD,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,KAAK;YAC5C,eAAe,EAAE,IAAI,CAAC,eAAe,IAAI,KAAK;SAC/C,CAAC;IACJ,CAAC;IAED,oDAAoD;IACpD,uBAAuB,CAAC,QAAsB;QAC5C,OAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;CACF"}
|
package/package.json
CHANGED
package/src/config.test-d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assertType, describe, test } from "vitest";
|
|
2
2
|
|
|
3
|
-
import { Block, BlockHeader, Transaction, TransactionMeta } from "./block";
|
|
3
|
+
import type { Block, BlockHeader, Transaction, TransactionMeta } from "./block";
|
|
4
4
|
import { FieldElement } from "./felt";
|
|
5
5
|
|
|
6
6
|
const address =
|
package/src/starknet/block.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldElement } from "./felt";
|
|
1
|
+
import type { FieldElement } from "./felt";
|
|
2
2
|
|
|
3
3
|
export type Block = Partial<{
|
|
4
4
|
/** Block header. */
|
|
@@ -27,7 +27,11 @@ export type BlockHeader = Partial<{
|
|
|
27
27
|
/** Block production timestamp. */
|
|
28
28
|
timestamp: string;
|
|
29
29
|
/** Price of L1 gas in the block. */
|
|
30
|
-
l1GasPrice
|
|
30
|
+
l1GasPrice?: ResourcePrice;
|
|
31
|
+
/** Price of L1 data gas in the block. */
|
|
32
|
+
l1DataGasPrice?: ResourcePrice;
|
|
33
|
+
/** L1 data availability mode. */
|
|
34
|
+
l1DataAvailabilityMode?: L1DataAvailabilityMode;
|
|
31
35
|
}>;
|
|
32
36
|
|
|
33
37
|
export type TransactionWithReceipt = {
|
|
@@ -281,7 +285,11 @@ export type TransactionReceipt = Partial<{
|
|
|
281
285
|
/** Events. */
|
|
282
286
|
events: Event[];
|
|
283
287
|
/** Revert reason. */
|
|
284
|
-
revertReason
|
|
288
|
+
revertReason: string;
|
|
289
|
+
/** Fee paid. */
|
|
290
|
+
actualFeePaid: FeePayment;
|
|
291
|
+
/** Resources consumed by the transaction. */
|
|
292
|
+
executionResources: ExecutionResources;
|
|
285
293
|
}>;
|
|
286
294
|
|
|
287
295
|
export type ExecutionStatus =
|
|
@@ -289,6 +297,55 @@ export type ExecutionStatus =
|
|
|
289
297
|
| "EXECUTION_STATUS_SUCCEEDED"
|
|
290
298
|
| "EXECUTION_STATUS_REVERTED";
|
|
291
299
|
|
|
300
|
+
export type FeePayment = Partial<{
|
|
301
|
+
/** Amount paid. */
|
|
302
|
+
amount: FieldElement;
|
|
303
|
+
/** Unit of the amount. */
|
|
304
|
+
unit: PriceUnit;
|
|
305
|
+
}>;
|
|
306
|
+
|
|
307
|
+
export type ExecutionResources = Partial<{
|
|
308
|
+
/** Computation resources. */
|
|
309
|
+
computation: ComputationResources;
|
|
310
|
+
/** Data availability resources. */
|
|
311
|
+
dataAvailability: DataAvailabilityResources;
|
|
312
|
+
}>;
|
|
313
|
+
|
|
314
|
+
export type ComputationResources = Partial<{
|
|
315
|
+
/** The gas consumed by this transaction's data, 0 if it uses data gas for DA. */
|
|
316
|
+
l1Gas: number;
|
|
317
|
+
/** The data gas consumed by this transaction's data, 0 if it uses gas for DA. */
|
|
318
|
+
l1DataGas: number;
|
|
319
|
+
}>;
|
|
320
|
+
|
|
321
|
+
export type DataAvailabilityResources = Partial<{
|
|
322
|
+
/** The number of Cairo steps used. */
|
|
323
|
+
steps: number;
|
|
324
|
+
/** The number of unused memory cells. */
|
|
325
|
+
memoryHoles: number;
|
|
326
|
+
/** The number of RANGE_CHECK builtin instances. */
|
|
327
|
+
rangeCheckBuiltinApplications: number;
|
|
328
|
+
/** The number of Pedersen builtin instances. */
|
|
329
|
+
pedersenBuiltinApplications: number;
|
|
330
|
+
/** The number of Poseidon builtin instances. */
|
|
331
|
+
poseidonBuiltinApplications: number;
|
|
332
|
+
/** The number of EC_OP builtin instances. */
|
|
333
|
+
ecOpBuiltinApplications: number;
|
|
334
|
+
/** The number of ECDSA builtin instances. */
|
|
335
|
+
ecdsaBuiltinApplications: number;
|
|
336
|
+
/** The number of BITWISE builtin instances. */
|
|
337
|
+
bitwiseBuiltinApplications: number;
|
|
338
|
+
/** The number of KECCAK builtin instances. */
|
|
339
|
+
keccakBuiltinApplications: number;
|
|
340
|
+
/** The number of accesses to the segment arena. */
|
|
341
|
+
segmentArenaBuiltin: number;
|
|
342
|
+
}>;
|
|
343
|
+
|
|
344
|
+
export type PriceUnit =
|
|
345
|
+
| "PRICE_UNIT_UNSPECIFIED"
|
|
346
|
+
| "PRICE_UNIT_FRI"
|
|
347
|
+
| "PRICE_UNIT_WEI";
|
|
348
|
+
|
|
292
349
|
export type Event = Partial<{
|
|
293
350
|
/** Event index. */
|
|
294
351
|
index: number;
|
|
@@ -403,3 +460,8 @@ export type DataAvailabilityMode =
|
|
|
403
460
|
| "DATA_AVAILABILITY_MODE_UNSPECIFIED"
|
|
404
461
|
| "DATA_AVAILABILITY_MODE_L2"
|
|
405
462
|
| "DATA_AVAILABILITY_MODE_L1";
|
|
463
|
+
|
|
464
|
+
export type L1DataAvailabilityMode =
|
|
465
|
+
| "L1_DATA_AVAILABILITY_MODE_UNSPECIFIED"
|
|
466
|
+
| "L1_DATA_AVAILABILITY_MODE_BLOB"
|
|
467
|
+
| "L1_DATA_AVAILABILITY_MODE_CALLDATA";
|
package/src/starknet/filter.ts
CHANGED
package/src/starknet/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ export * from "./block";
|
|
|
3
3
|
export { FieldElement, getSelector } from "./felt";
|
|
4
4
|
export { Contract } from "./parser";
|
|
5
5
|
|
|
6
|
-
import { Filter } from "./filter";
|
|
6
|
+
import type { Filter } from "./filter";
|
|
7
7
|
|
|
8
8
|
/** Starknet network type and data filter. */
|
|
9
9
|
export type Starknet = {
|
package/src/starknet/parser.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Abi, EventAbi } from "starknet";
|
|
2
2
|
|
|
3
|
-
import { FieldElement, getSelector } from "./felt";
|
|
4
|
-
import { EventFilter } from "./filter";
|
|
3
|
+
import { type FieldElement, getSelector } from "./felt";
|
|
4
|
+
import type { EventFilter } from "./filter";
|
|
5
5
|
|
|
6
6
|
/** Build a stream filter from a contract ABI. */
|
|
7
7
|
export class Contract {
|