@apibara/indexer 0.4.1 → 2.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +2 -9
  2. package/package.json +66 -45
  3. package/src/context.ts +19 -0
  4. package/src/hooks/index.ts +2 -0
  5. package/src/hooks/useKVStore.ts +12 -0
  6. package/src/hooks/useSink.ts +13 -0
  7. package/src/index.ts +7 -1
  8. package/src/indexer.test.ts +491 -0
  9. package/src/indexer.ts +322 -0
  10. package/src/otel.ts +3 -0
  11. package/src/plugins/config.ts +11 -0
  12. package/src/plugins/kv.test.ts +120 -0
  13. package/src/plugins/kv.ts +132 -0
  14. package/src/plugins/persistence.test.ts +151 -0
  15. package/src/plugins/persistence.ts +202 -0
  16. package/src/sink.ts +36 -0
  17. package/src/sinks/csv.test.ts +65 -0
  18. package/src/sinks/csv.ts +159 -0
  19. package/src/sinks/drizzle/Int8Range.ts +52 -0
  20. package/src/sinks/drizzle/delete.ts +42 -0
  21. package/src/sinks/drizzle/drizzle.test.ts +239 -0
  22. package/src/sinks/drizzle/drizzle.ts +115 -0
  23. package/src/sinks/drizzle/index.ts +6 -0
  24. package/src/sinks/drizzle/insert.ts +39 -0
  25. package/src/sinks/drizzle/select.ts +44 -0
  26. package/src/sinks/drizzle/transaction.ts +49 -0
  27. package/src/sinks/drizzle/update.ts +47 -0
  28. package/src/sinks/drizzle/utils.ts +36 -0
  29. package/src/sinks/sqlite.test.ts +99 -0
  30. package/src/sinks/sqlite.ts +170 -0
  31. package/src/testing/helper.ts +13 -0
  32. package/src/testing/index.ts +3 -0
  33. package/src/testing/indexer.ts +35 -0
  34. package/src/testing/setup.ts +59 -0
  35. package/src/testing/vcr.ts +54 -0
  36. package/src/vcr/config.ts +11 -0
  37. package/src/vcr/helper.ts +27 -0
  38. package/src/vcr/index.ts +4 -0
  39. package/src/vcr/record.ts +45 -0
  40. package/src/vcr/replay.ts +51 -0
  41. package/LICENSE.txt +0 -202
  42. package/dist/config.d.ts +0 -35
  43. package/dist/config.js +0 -2
  44. package/dist/config.js.map +0 -1
  45. package/dist/config.test-d.d.ts +0 -1
  46. package/dist/config.test-d.js +0 -38
  47. package/dist/config.test-d.js.map +0 -1
  48. package/dist/index.js +0 -2
  49. package/dist/index.js.map +0 -1
  50. package/dist/sink/console.d.ts +0 -10
  51. package/dist/sink/console.js +0 -2
  52. package/dist/sink/console.js.map +0 -1
  53. package/dist/sink/console.test-d.d.ts +0 -1
  54. package/dist/sink/console.test-d.js +0 -12
  55. package/dist/sink/console.test-d.js.map +0 -1
  56. package/dist/sink/mongo.d.ts +0 -14
  57. package/dist/sink/mongo.js +0 -2
  58. package/dist/sink/mongo.js.map +0 -1
  59. package/dist/sink/parquet.d.ts +0 -9
  60. package/dist/sink/parquet.js +0 -2
  61. package/dist/sink/parquet.js.map +0 -1
  62. package/dist/sink/postgres.d.ts +0 -10
  63. package/dist/sink/postgres.js +0 -2
  64. package/dist/sink/postgres.js.map +0 -1
  65. package/dist/sink/webhook.d.ts +0 -12
  66. package/dist/sink/webhook.js +0 -2
  67. package/dist/sink/webhook.js.map +0 -1
  68. package/dist/starknet/block.d.ts +0 -409
  69. package/dist/starknet/block.js +0 -2
  70. package/dist/starknet/block.js.map +0 -1
  71. package/dist/starknet/block.test-d.d.ts +0 -1
  72. package/dist/starknet/block.test-d.js +0 -95
  73. package/dist/starknet/block.test-d.js.map +0 -1
  74. package/dist/starknet/felt.d.ts +0 -11
  75. package/dist/starknet/felt.js +0 -25
  76. package/dist/starknet/felt.js.map +0 -1
  77. package/dist/starknet/felt.test.d.ts +0 -1
  78. package/dist/starknet/felt.test.js +0 -16
  79. package/dist/starknet/felt.test.js.map +0 -1
  80. package/dist/starknet/filter.d.ts +0 -175
  81. package/dist/starknet/filter.js +0 -2
  82. package/dist/starknet/filter.js.map +0 -1
  83. package/dist/starknet/filter.test-d.d.ts +0 -1
  84. package/dist/starknet/filter.test-d.js +0 -166
  85. package/dist/starknet/filter.test-d.js.map +0 -1
  86. package/dist/starknet/index.d.ts +0 -10
  87. package/dist/starknet/index.js +0 -5
  88. package/dist/starknet/index.js.map +0 -1
  89. package/dist/starknet/parser.d.ts +0 -16
  90. package/dist/starknet/parser.js +0 -49
  91. package/dist/starknet/parser.js.map +0 -1
  92. package/dist/starknet/parser.test.d.ts +0 -1
  93. package/dist/starknet/parser.test.js +0 -50
  94. package/dist/starknet/parser.test.js.map +0 -1
  95. package/src/config.test-d.ts +0 -55
  96. package/src/config.ts +0 -47
  97. package/src/sink/console.test-d.ts +0 -14
  98. package/src/sink/console.ts +0 -11
  99. package/src/sink/mongo.ts +0 -14
  100. package/src/sink/parquet.ts +0 -9
  101. package/src/sink/postgres.ts +0 -10
  102. package/src/sink/webhook.ts +0 -12
  103. package/src/starknet/block.test-d.ts +0 -112
  104. package/src/starknet/block.ts +0 -469
  105. package/src/starknet/felt.test.ts +0 -25
  106. package/src/starknet/felt.ts +0 -30
  107. package/src/starknet/filter.test-d.ts +0 -197
  108. package/src/starknet/filter.ts +0 -205
  109. package/src/starknet/index.ts +0 -12
  110. package/src/starknet/parser.test.ts +0 -67
  111. package/src/starknet/parser.ts +0 -69
  112. /package/{dist/index.d.ts → src/plugins/index.ts} +0 -0
package/dist/config.d.ts DELETED
@@ -1,35 +0,0 @@
1
- /** Sink-related options. */
2
- export type SinkOptions = {
3
- /** Sink type. */
4
- sinkType: string;
5
- /** Sink options. */
6
- sinkOptions: object;
7
- };
8
- /** Network-specific options. */
9
- export type NetworkOptions = {
10
- /** Network name. */
11
- network: string;
12
- /** Data filter. */
13
- filter: object;
14
- };
15
- /** Data finality. */
16
- export type Finality = "DATA_STATUS_FINALIZED" | "DATA_STATUS_ACCEPTED" | "DATA_STATUS_PENDING";
17
- /** Stream-related options. */
18
- export type StreamOptions = {
19
- /** The Apibara DNA stream url, e.g. `mainnet.starknet.a5a.ch`. */
20
- streamUrl?: string;
21
- /** Maximum message size, e.g. `50Mb` */
22
- maxMessageSize?: string;
23
- /** Additional metadata to send when connecting to the stream, in `key: value` form. */
24
- metadata?: string[];
25
- /** The Apibara DNA stream auth token. */
26
- authToken?: string;
27
- };
28
- export type Config<TNetworkOptions extends NetworkOptions = NetworkOptions, TSink extends SinkOptions = SinkOptions> = TSink & TNetworkOptions & StreamOptions & {
29
- /** How many historical blocks to process in a single batch. */
30
- batchSize?: number;
31
- /** Finality of the data to process. */
32
- finality?: Finality;
33
- /** Start streaming data from this block. */
34
- startingBlock?: number;
35
- };
package/dist/config.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- export {};
@@ -1,38 +0,0 @@
1
- import { assertType, describe, test } from "vitest";
2
- describe("Config", () => {
3
- test("without any network or sink type", () => {
4
- assertType({
5
- network: "test-network",
6
- filter: {},
7
- sinkType: "test-sink",
8
- sinkOptions: {},
9
- });
10
- });
11
- test("with restrictions on network and sink", () => {
12
- assertType({
13
- network: "test-network",
14
- filter: {
15
- a: 1,
16
- },
17
- sinkType: "test-sink",
18
- sinkOptions: {
19
- b: "test",
20
- },
21
- });
22
- });
23
- test("network options are required", () => {
24
- // @ts-expect-error - missing network options
25
- assertType({
26
- sinkType: "test-sink",
27
- sinkOptions: {},
28
- });
29
- });
30
- test("sink options are required", () => {
31
- // @ts-expect-error - missing sink options
32
- assertType({
33
- network: "test-network",
34
- filter: {},
35
- });
36
- });
37
- });
38
- //# sourceMappingURL=config.test-d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.test-d.js","sourceRoot":"","sources":["../src/config.test-d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAIpD,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,IAAI,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC5C,UAAU,CAAS;YACjB,OAAO,EAAE,cAAc;YACvB,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,EAAE;SAChB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAajD,UAAU,CAAwB;YAChC,OAAO,EAAE,cAAc;YACvB,MAAM,EAAE;gBACN,CAAC,EAAE,CAAC;aACL;YACD,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE;gBACX,CAAC,EAAE,MAAM;aACV;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACxC,6CAA6C;QAC7C,UAAU,CAAS;YACjB,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,EAAE;SAChB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACrC,0CAA0C;QAC1C,UAAU,CAAS;YACjB,OAAO,EAAE,cAAc;YACvB,MAAM,EAAE,EAAE;SACX,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/dist/index.js DELETED
@@ -1,2 +0,0 @@
1
- export * from "./config";
2
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -1,10 +0,0 @@
1
- /** Console sink type. */
2
- export type Console = {
3
- sinkType: "console";
4
- /** Accept any options.
5
- *
6
- * @remarks We do this so that users can quickly switch to the console sink to debug,
7
- * without having to remove the options from the config file.
8
- */
9
- sinkOptions: object;
10
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=console.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"console.js","sourceRoot":"","sources":["../../src/sink/console.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- export {};
@@ -1,12 +0,0 @@
1
- import { assertType, describe, test } from "vitest";
2
- describe("Console", () => {
3
- test("accepts any option", () => {
4
- assertType({
5
- sinkType: "console",
6
- sinkOptions: {
7
- hello: "world",
8
- },
9
- });
10
- });
11
- });
12
- //# sourceMappingURL=console.test-d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"console.test-d.js","sourceRoot":"","sources":["../../src/sink/console.test-d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAIpD,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,IAAI,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAC9B,UAAU,CAAU;YAClB,QAAQ,EAAE,SAAS;YACnB,WAAW,EAAE;gBACX,KAAK,EAAE,OAAO;aACf;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- /** MongoDB sink options */
2
- export type Mongo = {
3
- sinkType: "mongo";
4
- sinkOptions: {
5
- /** MongoDB connection string. */
6
- connectionString?: string;
7
- /** Target database name. */
8
- database?: string;
9
- /** Target collection name. */
10
- collectionName?: string;
11
- /** Enable entity mode. */
12
- entityMode?: boolean;
13
- };
14
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=mongo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mongo.js","sourceRoot":"","sources":["../../src/sink/mongo.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- export type Parquet = {
2
- sinkType: "parquet";
3
- sinkOptions: {
4
- /** Target output directory. */
5
- outputDir?: string;
6
- /** How many blocks to include in each file. */
7
- batchSize?: number;
8
- };
9
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=parquet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parquet.js","sourceRoot":"","sources":["../../src/sink/parquet.ts"],"names":[],"mappings":""}
@@ -1,10 +0,0 @@
1
- /** PostgreSQL sink options. */
2
- export type Postgres = {
3
- sinkType: "postgres";
4
- sinkOptions: {
5
- /** Postgres connection string. */
6
- connectionString?: string;
7
- /** Target table name. */
8
- tableName?: string;
9
- };
10
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=postgres.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"postgres.js","sourceRoot":"","sources":["../../src/sink/postgres.ts"],"names":[],"mappings":""}
@@ -1,12 +0,0 @@
1
- /** Webhook sink options */
2
- export type Webhook = {
3
- sinkType: "webhook";
4
- sinkOptions: {
5
- /** Target URL. */
6
- targetUrl?: string;
7
- /** Additional headers to send with the request, `key: value` format. */
8
- header?: string[];
9
- /** Send the data returned from the transform function as the request body. */
10
- raw?: boolean;
11
- };
12
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=webhook.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../src/sink/webhook.ts"],"names":[],"mappings":""}
@@ -1,409 +0,0 @@
1
- import type { FieldElement } from "./felt";
2
- export type Block = Partial<{
3
- /** Block header. */
4
- header: BlockHeader;
5
- /** Transactions. */
6
- transactions: TransactionWithReceipt[];
7
- /** Events. */
8
- events: EventWithTransaction[];
9
- /** Messages from L2 to L1. */
10
- l2ToL1Messages: L2ToL1MessageWithTransaction[];
11
- /** State update. */
12
- stateUpdate: StateUpdate;
13
- }>;
14
- export type BlockHeader = Partial<{
15
- /** Block hash. */
16
- blockHash: FieldElement;
17
- /** Parent block hash. */
18
- parentBlockHash: FieldElement;
19
- /** Block number. */
20
- blockNumber: string;
21
- /** Sequencer address. */
22
- sequencerAddress: FieldElement;
23
- /** New state root. */
24
- newRoot: FieldElement;
25
- /** Block production timestamp. */
26
- timestamp: string;
27
- /** Starknet version. */
28
- starknetVersion: string;
29
- /** Price of L1 gas in the block. */
30
- l1GasPrice?: ResourcePrice;
31
- /** Price of L1 data gas in the block. */
32
- l1DataGasPrice?: ResourcePrice;
33
- /** L1 data availability mode. */
34
- l1DataAvailabilityMode?: L1DataAvailabilityMode;
35
- }>;
36
- export type TransactionWithReceipt = {
37
- /** Transaction. */
38
- transaction: Transaction;
39
- /** Transaction receipt. */
40
- receipt: TransactionReceipt;
41
- };
42
- export type EventWithTransaction = {
43
- /** Transaction. */
44
- transaction: Transaction;
45
- /** Transaction receipt. */
46
- receipt: TransactionReceipt;
47
- /** Event. */
48
- event: Event;
49
- };
50
- export type L2ToL1MessageWithTransaction = {
51
- /** Transaction. */
52
- transaction: Transaction;
53
- /** Message from L2 to L1. */
54
- message: L2ToL1Message;
55
- };
56
- export type Transaction = TransactionCommon & (InvokeTransactionV0 | InvokeTransactionV1 | InvokeTransactionV3 | DeployTransaction | DeclareTransaction | DeclareTransactionV3 | DeployAccountTransaction | DeployAccountTransactionV3 | L1HandlerTransaction);
57
- export type TransactionCommon = {
58
- meta: TransactionMeta;
59
- };
60
- export type TransactionMeta = Partial<{
61
- /** Transaction hash. */
62
- hash: FieldElement;
63
- /** Maximum fee. */
64
- maxFee: FieldElement;
65
- /** Signature. */
66
- signature: FieldElement[];
67
- /** Nonce. */
68
- nonce: FieldElement;
69
- /** Transaction version. */
70
- version: string;
71
- /** Transaction resources. */
72
- resourceBounds?: ResourceBoundsMapping;
73
- /** Tip to the sequencer. */
74
- tip?: number;
75
- /** Data passed to the paymaster. */
76
- paymasterData?: FieldElement[];
77
- /** Account nonce's DA. */
78
- nonceDataAvailabilityMode?: DataAvailabilityMode;
79
- /** Transaction's DA. */
80
- feeDataAvailabilityMode?: DataAvailabilityMode;
81
- /** Transaction index in the block. */
82
- transactionIndex?: number;
83
- }>;
84
- export type InvokeTransactionV0 = {
85
- invokeV0?: Partial<{
86
- /** Target contract address. */
87
- contractAddress: FieldElement;
88
- /** Selector of the function being invoked. */
89
- entryPointSelector: FieldElement;
90
- /** Calldata. */
91
- calldata: FieldElement[];
92
- }>;
93
- invokeV1?: never;
94
- invokeV3?: never;
95
- deploy?: never;
96
- declare?: never;
97
- declareV3?: never;
98
- l1Handler?: never;
99
- deployAccount?: never;
100
- deployAccountV3?: never;
101
- };
102
- export type InvokeTransactionV1 = {
103
- invokeV1?: Partial<{
104
- /** Address of the account sending the transaction. */
105
- senderAddress: FieldElement;
106
- /** Calldata. */
107
- calldata: FieldElement[];
108
- }>;
109
- invokeV0?: never;
110
- invokeV3?: never;
111
- deploy?: never;
112
- declare?: never;
113
- declareV3?: never;
114
- l1Handler?: never;
115
- deployAccount?: never;
116
- deployAccountV3?: never;
117
- };
118
- export type InvokeTransactionV3 = {
119
- invokeV3?: Partial<{
120
- /** Address of the account sending the transaction. */
121
- senderAddress: FieldElement;
122
- /** Calldata. */
123
- calldata: FieldElement[];
124
- /** Data passed to the account deployment. */
125
- accountDeploymentData: FieldElement[];
126
- }>;
127
- invokeV1?: never;
128
- invokeV0?: never;
129
- deploy?: never;
130
- declare?: never;
131
- declareV3?: never;
132
- l1Handler?: never;
133
- deployAccount?: never;
134
- deployAccountV3?: never;
135
- };
136
- export type DeployTransaction = {
137
- deploy?: Partial<{
138
- /** Constructor calldata. */
139
- constructorCalldata: FieldElement[];
140
- /** Salt used when computing the contract's address. */
141
- contractAddressSalt: FieldElement;
142
- /** Hash of the class being deployed. */
143
- classHash: FieldElement;
144
- }>;
145
- invokeV0?: never;
146
- invokeV1?: never;
147
- invokeV3?: never;
148
- declare?: never;
149
- declareV3?: never;
150
- l1Handler?: never;
151
- deployAccount?: never;
152
- deployAccountV3?: never;
153
- };
154
- export type DeclareTransaction = {
155
- declare?: Partial<{
156
- /** Class hash. */
157
- classHash: FieldElement;
158
- /** Address of the account sending the transaction. */
159
- senderAddress: FieldElement;
160
- /** Hash of the cairo assembly resulting from the sierra compilation. */
161
- compiledClassHash: FieldElement;
162
- }>;
163
- declareV3?: never;
164
- invokeV0?: never;
165
- invokeV1?: never;
166
- invokeV3?: never;
167
- deploy?: never;
168
- l1Handler?: never;
169
- deployAccount?: never;
170
- deployAccountV3?: never;
171
- };
172
- export type DeclareTransactionV3 = {
173
- declareV3?: Partial<{
174
- /** Class hash. */
175
- classHash: FieldElement;
176
- /** Address of the account sending the transaction. */
177
- senderAddress: FieldElement;
178
- /** Hash of the cairo assembly resulting from the sierra compilation. */
179
- compiledClassHash: FieldElement;
180
- /** Data passed to the account deployment. */
181
- accountDeploymentData: FieldElement[];
182
- }>;
183
- declare?: never;
184
- invokeV0?: never;
185
- invokeV1?: never;
186
- invokeV3?: never;
187
- deploy?: never;
188
- deployAccountV3?: never;
189
- l1Handler?: never;
190
- deployAccount?: never;
191
- };
192
- export type DeployAccountTransaction = {
193
- deployAccount?: Partial<{
194
- /** Constructor calldata. */
195
- constructorCalldata: FieldElement[];
196
- /** Salt used when computing the contract's address. */
197
- contractAddressSalt: FieldElement;
198
- /** Hash of the class being deployed. */
199
- classHash: FieldElement;
200
- }>;
201
- deployAccountV3?: never;
202
- invokeV0?: never;
203
- invokeV1?: never;
204
- invokeV3?: never;
205
- deploy?: never;
206
- declare?: never;
207
- declareV3?: never;
208
- l1Handler?: never;
209
- };
210
- export type DeployAccountTransactionV3 = {
211
- deployAccountV3?: Partial<{
212
- /** Constructor calldata. */
213
- constructorCalldata: FieldElement[];
214
- /** Salt used when computing the contract's address. */
215
- contractAddressSalt: FieldElement;
216
- /** Hash of the class being deployed. */
217
- classHash: FieldElement;
218
- }>;
219
- deployAccount?: never;
220
- invokeV0?: never;
221
- invokeV1?: never;
222
- invokeV3?: never;
223
- deploy?: never;
224
- declare?: never;
225
- declareV3?: never;
226
- l1Handler?: never;
227
- };
228
- export type L1HandlerTransaction = {
229
- l1Handler?: Partial<{
230
- /** Target contract address. */
231
- contractAddress: FieldElement;
232
- /** Selector of the function being invoked. */
233
- entryPointSelector: FieldElement;
234
- /** Calldata. */
235
- calldata: FieldElement[];
236
- }>;
237
- invokeV0?: never;
238
- invokeV1?: never;
239
- invokeV3?: never;
240
- deploy?: never;
241
- declare?: never;
242
- declareV3?: never;
243
- deployAccount?: never;
244
- };
245
- export type TransactionReceipt = Partial<{
246
- /** Transaction status. */
247
- executionStatus: ExecutionStatus;
248
- /** Transaction hash. */
249
- transactionHash: FieldElement;
250
- /** Transaction index. */
251
- transactionIndex: string;
252
- /** Actual fee paid by the account. */
253
- actualFee: FieldElement;
254
- /** Address of the contract created by the transaction. */
255
- contractAddress: FieldElement;
256
- /** Messages from L2 to L1. */
257
- l2ToL1Messages: L2ToL1Message[];
258
- /** Events. */
259
- events: Event[];
260
- /** Revert reason. */
261
- revertReason: string;
262
- /** Fee paid. */
263
- actualFeePaid: FeePayment;
264
- /** Resources consumed by the transaction. */
265
- executionResources: ExecutionResources;
266
- }>;
267
- export type ExecutionStatus = "EXECUTION_STATUS_UNSPECIFIED" | "EXECUTION_STATUS_SUCCEEDED" | "EXECUTION_STATUS_REVERTED";
268
- export type FeePayment = Partial<{
269
- /** Amount paid. */
270
- amount: FieldElement;
271
- /** Unit of the amount. */
272
- unit: PriceUnit;
273
- }>;
274
- export type ExecutionResources = Partial<{
275
- /** Computation resources. */
276
- computation: ComputationResources;
277
- /** Data availability resources. */
278
- dataAvailability: DataAvailabilityResources;
279
- }>;
280
- export type DataAvailabilityResources = Partial<{
281
- /** The gas consumed by this transaction's data, 0 if it uses data gas for DA. */
282
- l1Gas: number;
283
- /** The data gas consumed by this transaction's data, 0 if it uses gas for DA. */
284
- l1DataGas: number;
285
- }>;
286
- export type ComputationResources = Partial<{
287
- /** The number of Cairo steps used. */
288
- steps: number;
289
- /** The number of unused memory cells. */
290
- memoryHoles: number;
291
- /** The number of RANGE_CHECK builtin instances. */
292
- rangeCheckBuiltinApplications: number;
293
- /** The number of Pedersen builtin instances. */
294
- pedersenBuiltinApplications: number;
295
- /** The number of Poseidon builtin instances. */
296
- poseidonBuiltinApplications: number;
297
- /** The number of EC_OP builtin instances. */
298
- ecOpBuiltinApplications: number;
299
- /** The number of ECDSA builtin instances. */
300
- ecdsaBuiltinApplications: number;
301
- /** The number of BITWISE builtin instances. */
302
- bitwiseBuiltinApplications: number;
303
- /** The number of KECCAK builtin instances. */
304
- keccakBuiltinApplications: number;
305
- /** The number of accesses to the segment arena. */
306
- segmentArenaBuiltin: number;
307
- }>;
308
- export type PriceUnit = "PRICE_UNIT_UNSPECIFIED" | "PRICE_UNIT_FRI" | "PRICE_UNIT_WEI";
309
- export type Event = Partial<{
310
- /** Event index. */
311
- index: number;
312
- /** Contract address. */
313
- fromAddress: FieldElement;
314
- /** Event selector. */
315
- keys: FieldElement[];
316
- /** Event data. */
317
- data: FieldElement[];
318
- }>;
319
- export type L2ToL1Message = Partial<{
320
- /** Message index. */
321
- index: number;
322
- /** L2 sender address. */
323
- fromAddress: FieldElement;
324
- /** L1 target address. */
325
- toAddress: FieldElement;
326
- /** Calldata. */
327
- payload: FieldElement[];
328
- }>;
329
- export type StateUpdate = Partial<{
330
- /** New state root. */
331
- newRoot: FieldElement;
332
- /** Old state root. */
333
- oldRoot: FieldElement;
334
- /** State diff. */
335
- stateDiff: StateDiff;
336
- }>;
337
- export type StateDiff = Partial<{
338
- /** Changes in storage. */
339
- storageDiffs: StorageDiff[];
340
- /** Declared contracts. */
341
- declaredContracts: DeclaredContract[];
342
- /** Deployed contracts. */
343
- deployedContracts: DeployedContract[];
344
- /** Nonce updates. */
345
- nonces: NonceUpdate[];
346
- /** Classes declared. */
347
- declaredClasses: DeclaredClass[];
348
- /** Classes replaced. */
349
- replacedClasses: ReplacedClass[];
350
- }>;
351
- export type StorageDiff = Partial<{
352
- /** Contract address. */
353
- contractAddress: FieldElement;
354
- /** Changes in storage. */
355
- storageEntries: StorageEntry[];
356
- }>;
357
- export type StorageEntry = Partial<{
358
- /** Storage key. */
359
- key: FieldElement;
360
- /** New storage value. */
361
- value: FieldElement;
362
- }>;
363
- export type DeclaredContract = Partial<{
364
- /** Class hash. */
365
- classHash: FieldElement;
366
- }>;
367
- export type DeclaredClass = Partial<{
368
- /** Class hash. */
369
- classHash: FieldElement;
370
- /** Compiled class hash. */
371
- compiledClassHash: FieldElement;
372
- }>;
373
- export type ReplacedClass = Partial<{
374
- /** Contract address. */
375
- contractAddress: FieldElement;
376
- /** Class hash. */
377
- classHash: FieldElement;
378
- }>;
379
- export type DeployedContract = Partial<{
380
- /** Contract address. */
381
- contractAddress: FieldElement;
382
- /** Class hash. */
383
- classHash: FieldElement;
384
- }>;
385
- export type NonceUpdate = Partial<{
386
- /** Contract address. */
387
- contractAddress: FieldElement;
388
- /** New nonce. */
389
- nonce: FieldElement;
390
- }>;
391
- export type ResourcePrice = Partial<{
392
- /** Price in fri (10^-18 strk). */
393
- priceInFri: FieldElement;
394
- /** Price in wei (10^-18 eth). */
395
- priceInWei: FieldElement;
396
- }>;
397
- export type ResourceBoundsMapping = Partial<{
398
- l1Gas: ResourceBounds;
399
- l2Gas: ResourceBounds;
400
- }>;
401
- export type ResourceBounds = Partial<{
402
- maxAmount: number;
403
- maxPricePerUnit: Partial<{
404
- low: number;
405
- high: number;
406
- }>;
407
- }>;
408
- export type DataAvailabilityMode = "DATA_AVAILABILITY_MODE_UNSPECIFIED" | "DATA_AVAILABILITY_MODE_L2" | "DATA_AVAILABILITY_MODE_L1";
409
- export type L1DataAvailabilityMode = "L1_DATA_AVAILABILITY_MODE_UNSPECIFIED" | "L1_DATA_AVAILABILITY_MODE_BLOB" | "L1_DATA_AVAILABILITY_MODE_CALLDATA";
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=block.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"block.js","sourceRoot":"","sources":["../../src/starknet/block.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- export {};