@apibara/starknet 0.3.1 → 0.5.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/cursor.d.ts +1 -1
- package/dist/filter.d.ts +1 -1
- package/dist/filter.js +16 -0
- package/dist/filter.js.map +1 -1
- package/dist/proto/generated.d.ts +1409 -68
- package/dist/proto/generated.js +4357 -701
- package/dist/proto/generated.js.map +1 -1
- package/dist/proto/index.js +0 -1
- package/dist/proto/index.js.map +1 -1
- package/dist/proto/starknet.proto +185 -2
- package/package.json +1 -1
- package/src/cursor.ts +1 -1
- package/src/filter.ts +1 -1
- package/src/proto/generated.d.ts +1409 -68
- package/src/proto/generated.js +5590 -1741
- package/src/proto/index.ts +0 -1
- package/src/proto/starknet.proto +185 -2
package/dist/proto/index.js
CHANGED
|
@@ -2,6 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.v1alpha2 = void 0;
|
|
4
4
|
const generated_1 = require("./generated");
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
5
|
exports.v1alpha2 = generated_1.apibara.starknet.v1alpha2;
|
|
7
6
|
//# sourceMappingURL=index.js.map
|
package/dist/proto/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/proto/index.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/proto/index.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAExB,QAAA,QAAQ,GAAG,mBAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC"}
|
|
@@ -20,6 +20,8 @@ message Block {
|
|
|
20
20
|
repeated EventWithTransaction events = 5;
|
|
21
21
|
// Messages to L1 sent in the block.
|
|
22
22
|
repeated L2ToL1MessageWithTransaction l2_to_l1_messages = 6;
|
|
23
|
+
// Whether the block contains data.
|
|
24
|
+
bool empty = 7;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
// Block header.
|
|
@@ -36,6 +38,23 @@ message BlockHeader {
|
|
|
36
38
|
FieldElement new_root = 5;
|
|
37
39
|
// Timestamp when block was produced.
|
|
38
40
|
google.protobuf.Timestamp timestamp = 6;
|
|
41
|
+
// Starknet version.
|
|
42
|
+
string starknet_version = 7;
|
|
43
|
+
// Price of L1 gas in the block.
|
|
44
|
+
ResourcePrice l1_gas_price = 8;
|
|
45
|
+
// Price of L1 data gas in the block.
|
|
46
|
+
ResourcePrice l1_data_gas_price = 9;
|
|
47
|
+
// L1 data availability mode.
|
|
48
|
+
L1DataAvailabilityMode l1_data_availability_mode = 10;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
enum L1DataAvailabilityMode {
|
|
52
|
+
// Unknown DA.
|
|
53
|
+
L1_DATA_AVAILABILITY_MODE_UNSPECIFIED = 0;
|
|
54
|
+
// Data published via blobs.
|
|
55
|
+
L1_DATA_AVAILABILITY_MODE_BLOB = 1;
|
|
56
|
+
// Data published via calldata.
|
|
57
|
+
L1_DATA_AVAILABILITY_MODE_CALLDATA = 2;
|
|
39
58
|
}
|
|
40
59
|
|
|
41
60
|
// Status of a block.
|
|
@@ -69,7 +88,7 @@ message Transaction {
|
|
|
69
88
|
InvokeTransactionV0 invoke_v0 = 2;
|
|
70
89
|
// Transaction invoking a smart contract, V1.
|
|
71
90
|
InvokeTransactionV1 invoke_v1 = 3;
|
|
72
|
-
// Transaction deploying a new smart contract.
|
|
91
|
+
// Transaction deploying a new smart contract, V1.
|
|
73
92
|
DeployTransaction deploy = 4;
|
|
74
93
|
// Transaction declaring a smart contract.
|
|
75
94
|
DeclareTransaction declare = 5;
|
|
@@ -77,6 +96,12 @@ message Transaction {
|
|
|
77
96
|
L1HandlerTransaction l1_handler = 6;
|
|
78
97
|
// Transaction deploying a new account.
|
|
79
98
|
DeployAccountTransaction deploy_account = 7;
|
|
99
|
+
// Transaction deploying a new smart contract, V3.
|
|
100
|
+
DeployAccountTransactionV3 deploy_account_v3 = 8;
|
|
101
|
+
// Transaction invoking a smart contract, V3.
|
|
102
|
+
InvokeTransactionV3 invoke_v3 = 9;
|
|
103
|
+
// Transaction declaring a smart contract, V3.
|
|
104
|
+
DeclareTransactionV3 declare_v3 = 10;
|
|
80
105
|
}
|
|
81
106
|
}
|
|
82
107
|
|
|
@@ -92,6 +117,18 @@ message TransactionMeta {
|
|
|
92
117
|
FieldElement nonce = 4;
|
|
93
118
|
// Version.
|
|
94
119
|
uint64 version = 5;
|
|
120
|
+
// Transaction resources.
|
|
121
|
+
ResourceBoundsMapping resource_bounds = 6;
|
|
122
|
+
// Tip to the sequencer.
|
|
123
|
+
uint64 tip = 7;
|
|
124
|
+
// Data passed to the paymaster.
|
|
125
|
+
repeated FieldElement paymaster_data = 8;
|
|
126
|
+
// The storage domain of the account's nonce.
|
|
127
|
+
DataAvailabilityMode nonce_data_availability_mode = 9;
|
|
128
|
+
// The storage domain of the account's balance from which fee will be charged.
|
|
129
|
+
DataAvailabilityMode fee_data_availability_mode = 10;
|
|
130
|
+
// Index of the transaction in the block.
|
|
131
|
+
uint64 transaction_index = 11;
|
|
95
132
|
}
|
|
96
133
|
|
|
97
134
|
// Transaction invoking a smart contract, V0.
|
|
@@ -112,7 +149,17 @@ message InvokeTransactionV1 {
|
|
|
112
149
|
repeated FieldElement calldata = 2;
|
|
113
150
|
}
|
|
114
151
|
|
|
115
|
-
// Transaction
|
|
152
|
+
// Transaction invoking a smart contract, V3.
|
|
153
|
+
message InvokeTransactionV3 {
|
|
154
|
+
// Address sending the transaction.
|
|
155
|
+
FieldElement sender_address = 1;
|
|
156
|
+
// Raw calldata.
|
|
157
|
+
repeated FieldElement calldata = 2;
|
|
158
|
+
// Data passed to the account deployment.
|
|
159
|
+
repeated FieldElement account_deployment_data = 3;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Transaction deploying a new smart contract, V1.
|
|
116
163
|
message DeployTransaction {
|
|
117
164
|
// Raw calldata passed to the constructor.
|
|
118
165
|
repeated FieldElement constructor_calldata = 2;
|
|
@@ -132,6 +179,18 @@ message DeclareTransaction {
|
|
|
132
179
|
FieldElement compiled_class_hash = 3;
|
|
133
180
|
}
|
|
134
181
|
|
|
182
|
+
// Transaction declaring a smart contract.
|
|
183
|
+
message DeclareTransactionV3 {
|
|
184
|
+
// Class hash.
|
|
185
|
+
FieldElement class_hash = 1;
|
|
186
|
+
// Address of the account declaring the class.
|
|
187
|
+
FieldElement sender_address = 2;
|
|
188
|
+
// The hash of the cairo assembly resulting from the sierra compilation.
|
|
189
|
+
FieldElement compiled_class_hash = 3;
|
|
190
|
+
// Data passed to the account deployment.
|
|
191
|
+
repeated FieldElement account_deployment_data = 4;
|
|
192
|
+
}
|
|
193
|
+
|
|
135
194
|
// Transaction handling a message from L1.
|
|
136
195
|
message L1HandlerTransaction {
|
|
137
196
|
// Target contract address.
|
|
@@ -152,6 +211,26 @@ message DeployAccountTransaction {
|
|
|
152
211
|
FieldElement class_hash = 4;
|
|
153
212
|
}
|
|
154
213
|
|
|
214
|
+
// Transaction deploying a new smart contract, V3.
|
|
215
|
+
message DeployAccountTransactionV3 {
|
|
216
|
+
// Raw calldata passed to the constructor.
|
|
217
|
+
repeated FieldElement constructor_calldata = 1;
|
|
218
|
+
// Salt used when computing the contract's address.
|
|
219
|
+
FieldElement contract_address_salt = 2;
|
|
220
|
+
// Hash of the class being deployed.
|
|
221
|
+
FieldElement class_hash = 3;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Transaction execution status.
|
|
225
|
+
enum ExecutionStatus {
|
|
226
|
+
// Unknown execution status.
|
|
227
|
+
EXECUTION_STATUS_UNSPECIFIED = 0;
|
|
228
|
+
// Transaction succeeded.
|
|
229
|
+
EXECUTION_STATUS_SUCCEEDED = 1;
|
|
230
|
+
// Transaction reverted.
|
|
231
|
+
EXECUTION_STATUS_REVERTED = 2;
|
|
232
|
+
}
|
|
233
|
+
|
|
155
234
|
// Result of the execution of a transaction.
|
|
156
235
|
//
|
|
157
236
|
// This message only contains the receipt data, if you also need the
|
|
@@ -169,6 +248,14 @@ message TransactionReceipt {
|
|
|
169
248
|
repeated Event events = 5;
|
|
170
249
|
// Address of the contract that was created by the transaction.
|
|
171
250
|
FieldElement contract_address = 6;
|
|
251
|
+
// Transaction execution status.
|
|
252
|
+
ExecutionStatus execution_status = 7;
|
|
253
|
+
// The reason why the transaction reverted.
|
|
254
|
+
string revert_reason = 8;
|
|
255
|
+
// Feed paid.
|
|
256
|
+
FeePayment actual_fee_paid = 9;
|
|
257
|
+
// The resources consumed by the transaction.
|
|
258
|
+
ExecutionResources execution_resources = 10;
|
|
172
259
|
}
|
|
173
260
|
|
|
174
261
|
// Message sent from L2 to L1 together with its transaction and receipt.
|
|
@@ -294,3 +381,99 @@ message NonceUpdate {
|
|
|
294
381
|
// New nonce value.
|
|
295
382
|
FieldElement nonce = 2;
|
|
296
383
|
}
|
|
384
|
+
|
|
385
|
+
// Price of a unit of a resource.
|
|
386
|
+
message ResourcePrice {
|
|
387
|
+
// Price in fri (10^-18 strk).
|
|
388
|
+
FieldElement price_in_fri = 1;
|
|
389
|
+
// Price in wei (10^-18 eth).
|
|
390
|
+
FieldElement price_in_wei = 2;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// A Starknet fee payment.
|
|
394
|
+
message FeePayment {
|
|
395
|
+
// Amount paid.
|
|
396
|
+
FieldElement amount = 1;
|
|
397
|
+
// Unit of the amount.
|
|
398
|
+
PriceUnit unit = 2;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// Price unit.
|
|
402
|
+
enum PriceUnit {
|
|
403
|
+
// Unknown price unit.
|
|
404
|
+
PRICE_UNIT_UNSPECIFIED = 0;
|
|
405
|
+
// WEI.
|
|
406
|
+
PRICE_UNIT_WEI = 1;
|
|
407
|
+
// FRI.
|
|
408
|
+
PRICE_UNIT_FRI = 2;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
// Execution resources.
|
|
412
|
+
message ExecutionResources {
|
|
413
|
+
// Computation resources.
|
|
414
|
+
ComputationResources computation = 1;
|
|
415
|
+
// Data availability resources.
|
|
416
|
+
DataAvailabilityResources data_availability = 2;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// Computation resources.
|
|
420
|
+
message ComputationResources {
|
|
421
|
+
// The number of Cairo steps used.
|
|
422
|
+
uint64 steps = 1;
|
|
423
|
+
// The number of unused memory cells.
|
|
424
|
+
uint64 memory_holes = 2;
|
|
425
|
+
// The number of RANGE_CHECK builtin instances.
|
|
426
|
+
uint64 range_check_builtin_applications = 3;
|
|
427
|
+
// The number of Pedersen builtin instances.
|
|
428
|
+
uint64 pedersen_builtin_applications = 4;
|
|
429
|
+
// The number of Poseidon builtin instances.
|
|
430
|
+
uint64 poseidon_builtin_applications = 5;
|
|
431
|
+
// The number of EC_OP builtin instances.
|
|
432
|
+
uint64 ec_op_builtin_applications = 6;
|
|
433
|
+
// The number of ECDSA builtin instances.
|
|
434
|
+
uint64 ecdsa_builtin_applications = 7;
|
|
435
|
+
// The number of BITWISE builtin instances.
|
|
436
|
+
uint64 bitwise_builtin_applications = 8;
|
|
437
|
+
// The number of KECCAK builtin instances.
|
|
438
|
+
uint64 keccak_builtin_applications = 9;
|
|
439
|
+
// The number of accesses to the segment arena.
|
|
440
|
+
uint64 segment_arena_builtin = 10;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
message DataAvailabilityResources {
|
|
444
|
+
// The gas consumed by this transaction's data, 0 if it uses data gas for DA.
|
|
445
|
+
uint64 l1_gas = 1;
|
|
446
|
+
// The data gas consumed by this transaction's data, 0 if it uses gas for DA.
|
|
447
|
+
uint64 l1_data_gas = 2;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
message ResourceBoundsMapping {
|
|
451
|
+
// Maximum amount and price of L1 gas.
|
|
452
|
+
ResourceBounds l1_gas = 1;
|
|
453
|
+
// Maximum amount and price of L2 gas.
|
|
454
|
+
ResourceBounds l2_gas = 2;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
message ResourceBounds {
|
|
458
|
+
// The maximum amount of resources that can be consumed by a transaction.
|
|
459
|
+
uint64 max_amount = 1;
|
|
460
|
+
/// The max price per unit of resource.
|
|
461
|
+
Uint128 max_price_per_unit = 2;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
message Uint128 {
|
|
465
|
+
// The low 64 bits of the number.
|
|
466
|
+
uint64 low = 1;
|
|
467
|
+
// The high 64 bits of the number.
|
|
468
|
+
uint64 high = 2;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// DA mode.
|
|
472
|
+
enum DataAvailabilityMode {
|
|
473
|
+
// Unknown DA.
|
|
474
|
+
DATA_AVAILABILITY_MODE_UNSPECIFIED = 0;
|
|
475
|
+
// L1.
|
|
476
|
+
DATA_AVAILABILITY_MODE_L1 = 1;
|
|
477
|
+
// L2.
|
|
478
|
+
DATA_AVAILABILITY_MODE_L2 = 2;
|
|
479
|
+
}
|
package/package.json
CHANGED
package/src/cursor.ts
CHANGED
package/src/filter.ts
CHANGED
|
@@ -771,7 +771,7 @@ function createFilter<T, B>(
|
|
|
771
771
|
filterOrBuilder: IEncodable<T> | ((builder: B) => IEncodable<T>),
|
|
772
772
|
mk: () => B,
|
|
773
773
|
) {
|
|
774
|
-
let filter
|
|
774
|
+
let filter: IEncodable<T>;
|
|
775
775
|
if (typeof filterOrBuilder === "function") {
|
|
776
776
|
filter = filterOrBuilder(mk());
|
|
777
777
|
} else {
|