@apibara/starknet 2.1.0-beta.45 → 2.1.0-beta.46

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.45",
3
+ "version": "2.1.0-beta.46",
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.45",
45
+ "@apibara/protocol": "2.1.0-beta.46",
46
46
  "@scure/starknet": "^1.1.0",
47
47
  "abi-wan-kanabi": "^2.2.4",
48
48
  "long": "^5.2.1",
package/src/block.ts CHANGED
@@ -182,6 +182,7 @@ export type DataAvailabilityMode = CodecType<typeof DataAvailabilityMode>;
182
182
  * @prop l1GasPrice Calldata gas price.
183
183
  * @prop l1DataGasPrice Blob gas price.
184
184
  * @prop l1DataAvailabilityMode How data is posted to L1.
185
+ * @prop l2GasPrice L2 gas price.
185
186
  */
186
187
  export const BlockHeader = MessageCodec({
187
188
  blockHash: OptionalCodec(FieldElement),
@@ -194,6 +195,7 @@ export const BlockHeader = MessageCodec({
194
195
  l1GasPrice: RequiredCodec(ResourcePrice),
195
196
  l1DataGasPrice: RequiredCodec(ResourcePrice),
196
197
  l1DataAvailabilityMode: RequiredCodec(L1DataAvailabilityMode),
198
+ l2GasPrice: OptionalCodec(ResourcePrice),
197
199
  });
198
200
 
199
201
  export type BlockHeader = Readonly<CodecType<typeof BlockHeader>>;
package/src/proto/data.ts CHANGED
@@ -346,7 +346,11 @@ export interface BlockHeader {
346
346
  | ResourcePrice
347
347
  | undefined;
348
348
  /** L1 data availability mode. */
349
- readonly l1DataAvailabilityMode?: L1DataAvailabilityMode | undefined;
349
+ readonly l1DataAvailabilityMode?:
350
+ | L1DataAvailabilityMode
351
+ | undefined;
352
+ /** Price of L2 gas in the block. */
353
+ readonly l2GasPrice?: ResourcePrice | undefined;
350
354
  }
351
355
 
352
356
  /** A transaction. */
@@ -1088,6 +1092,7 @@ function createBaseBlockHeader(): BlockHeader {
1088
1092
  l1GasPrice: undefined,
1089
1093
  l1DataGasPrice: undefined,
1090
1094
  l1DataAvailabilityMode: 0,
1095
+ l2GasPrice: undefined,
1091
1096
  };
1092
1097
  }
1093
1098
 
@@ -1126,6 +1131,9 @@ export const BlockHeader = {
1126
1131
  if (message.l1DataAvailabilityMode !== undefined && message.l1DataAvailabilityMode !== 0) {
1127
1132
  writer.uint32(80).int32(message.l1DataAvailabilityMode);
1128
1133
  }
1134
+ if (message.l2GasPrice !== undefined) {
1135
+ ResourcePrice.encode(message.l2GasPrice, writer.uint32(90).fork()).ldelim();
1136
+ }
1129
1137
  return writer;
1130
1138
  },
1131
1139
 
@@ -1206,6 +1214,13 @@ export const BlockHeader = {
1206
1214
 
1207
1215
  message.l1DataAvailabilityMode = reader.int32() as any;
1208
1216
  continue;
1217
+ case 11:
1218
+ if (tag !== 90) {
1219
+ break;
1220
+ }
1221
+
1222
+ message.l2GasPrice = ResourcePrice.decode(reader, reader.uint32());
1223
+ continue;
1209
1224
  }
1210
1225
  if ((tag & 7) === 4 || tag === 0) {
1211
1226
  break;
@@ -1229,6 +1244,7 @@ export const BlockHeader = {
1229
1244
  l1DataAvailabilityMode: isSet(object.l1DataAvailabilityMode)
1230
1245
  ? l1DataAvailabilityModeFromJSON(object.l1DataAvailabilityMode)
1231
1246
  : 0,
1247
+ l2GasPrice: isSet(object.l2GasPrice) ? ResourcePrice.fromJSON(object.l2GasPrice) : undefined,
1232
1248
  };
1233
1249
  },
1234
1250
 
@@ -1264,6 +1280,9 @@ export const BlockHeader = {
1264
1280
  if (message.l1DataAvailabilityMode !== undefined && message.l1DataAvailabilityMode !== 0) {
1265
1281
  obj.l1DataAvailabilityMode = l1DataAvailabilityModeToJSON(message.l1DataAvailabilityMode);
1266
1282
  }
1283
+ if (message.l2GasPrice !== undefined) {
1284
+ obj.l2GasPrice = ResourcePrice.toJSON(message.l2GasPrice);
1285
+ }
1267
1286
  return obj;
1268
1287
  },
1269
1288
 
@@ -1294,6 +1313,9 @@ export const BlockHeader = {
1294
1313
  ? ResourcePrice.fromPartial(object.l1DataGasPrice)
1295
1314
  : undefined;
1296
1315
  message.l1DataAvailabilityMode = object.l1DataAvailabilityMode ?? 0;
1316
+ message.l2GasPrice = (object.l2GasPrice !== undefined && object.l2GasPrice !== null)
1317
+ ? ResourcePrice.fromPartial(object.l2GasPrice)
1318
+ : undefined;
1297
1319
  return message;
1298
1320
  },
1299
1321
  };