@apibara/starknet 2.1.0-beta.44 → 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/dist/index.d.cts CHANGED
@@ -123,6 +123,8 @@ interface BlockHeader$1 {
123
123
  readonly l1DataGasPrice?: ResourcePrice$1 | undefined;
124
124
  /** L1 data availability mode. */
125
125
  readonly l1DataAvailabilityMode?: L1DataAvailabilityMode$1 | undefined;
126
+ /** Price of L2 gas in the block. */
127
+ readonly l2GasPrice?: ResourcePrice$1 | undefined;
126
128
  }
127
129
  declare const BlockHeader$1: {
128
130
  encode(message: BlockHeader$1, writer?: _m0.Writer): _m0.Writer;
@@ -1464,6 +1466,7 @@ type DataAvailabilityMode = CodecType<typeof DataAvailabilityMode>;
1464
1466
  * @prop l1GasPrice Calldata gas price.
1465
1467
  * @prop l1DataGasPrice Blob gas price.
1466
1468
  * @prop l1DataAvailabilityMode How data is posted to L1.
1469
+ * @prop l2GasPrice L2 gas price.
1467
1470
  */
1468
1471
  declare const BlockHeader: MessageCodec<{
1469
1472
  blockHash: Codec<`0x${string}` | undefined, FieldElement | undefined>;
@@ -1488,6 +1491,13 @@ declare const BlockHeader: MessageCodec<{
1488
1491
  priceInWei?: FieldElement | undefined;
1489
1492
  } | undefined>;
1490
1493
  l1DataAvailabilityMode: Codec<"unknown", L1DataAvailabilityMode$1 | undefined> | Codec<"blob", L1DataAvailabilityMode$1 | undefined> | Codec<"calldata", L1DataAvailabilityMode$1 | undefined>;
1494
+ l2GasPrice: Codec<{
1495
+ priceInFri?: `0x${string}` | undefined;
1496
+ priceInWei?: `0x${string}` | undefined;
1497
+ } | undefined, {
1498
+ priceInFri?: FieldElement | undefined;
1499
+ priceInWei?: FieldElement | undefined;
1500
+ } | undefined>;
1491
1501
  }>;
1492
1502
  type BlockHeader = Readonly<CodecType<typeof BlockHeader>>;
1493
1503
  /** Transaction metadata.
@@ -4749,6 +4759,10 @@ declare const Block: MessageCodec<{
4749
4759
  priceInWei?: `0x${string}` | undefined;
4750
4760
  };
4751
4761
  l1DataAvailabilityMode: "unknown" | "blob" | "calldata";
4762
+ l2GasPrice?: {
4763
+ priceInFri?: `0x${string}` | undefined;
4764
+ priceInWei?: `0x${string}` | undefined;
4765
+ } | undefined;
4752
4766
  }, {
4753
4767
  blockHash?: FieldElement | undefined;
4754
4768
  parentBlockHash?: FieldElement | undefined;
@@ -4766,6 +4780,10 @@ declare const Block: MessageCodec<{
4766
4780
  priceInWei?: FieldElement | undefined;
4767
4781
  } | undefined;
4768
4782
  l1DataAvailabilityMode?: L1DataAvailabilityMode$1 | undefined;
4783
+ l2GasPrice?: {
4784
+ priceInFri?: FieldElement | undefined;
4785
+ priceInWei?: FieldElement | undefined;
4786
+ } | undefined;
4769
4787
  } | undefined>;
4770
4788
  transactions: Codec<readonly {
4771
4789
  filterIds: readonly number[];
@@ -6190,6 +6208,10 @@ declare const StarknetStream: StreamConfig<Readonly<{
6190
6208
  priceInWei?: `0x${string}` | undefined;
6191
6209
  };
6192
6210
  l1DataAvailabilityMode: "unknown" | "blob" | "calldata";
6211
+ l2GasPrice?: {
6212
+ priceInFri?: `0x${string}` | undefined;
6213
+ priceInWei?: `0x${string}` | undefined;
6214
+ } | undefined;
6193
6215
  };
6194
6216
  transactions: readonly {
6195
6217
  filterIds: readonly number[];
package/dist/index.d.mts CHANGED
@@ -123,6 +123,8 @@ interface BlockHeader$1 {
123
123
  readonly l1DataGasPrice?: ResourcePrice$1 | undefined;
124
124
  /** L1 data availability mode. */
125
125
  readonly l1DataAvailabilityMode?: L1DataAvailabilityMode$1 | undefined;
126
+ /** Price of L2 gas in the block. */
127
+ readonly l2GasPrice?: ResourcePrice$1 | undefined;
126
128
  }
127
129
  declare const BlockHeader$1: {
128
130
  encode(message: BlockHeader$1, writer?: _m0.Writer): _m0.Writer;
@@ -1464,6 +1466,7 @@ type DataAvailabilityMode = CodecType<typeof DataAvailabilityMode>;
1464
1466
  * @prop l1GasPrice Calldata gas price.
1465
1467
  * @prop l1DataGasPrice Blob gas price.
1466
1468
  * @prop l1DataAvailabilityMode How data is posted to L1.
1469
+ * @prop l2GasPrice L2 gas price.
1467
1470
  */
1468
1471
  declare const BlockHeader: MessageCodec<{
1469
1472
  blockHash: Codec<`0x${string}` | undefined, FieldElement | undefined>;
@@ -1488,6 +1491,13 @@ declare const BlockHeader: MessageCodec<{
1488
1491
  priceInWei?: FieldElement | undefined;
1489
1492
  } | undefined>;
1490
1493
  l1DataAvailabilityMode: Codec<"unknown", L1DataAvailabilityMode$1 | undefined> | Codec<"blob", L1DataAvailabilityMode$1 | undefined> | Codec<"calldata", L1DataAvailabilityMode$1 | undefined>;
1494
+ l2GasPrice: Codec<{
1495
+ priceInFri?: `0x${string}` | undefined;
1496
+ priceInWei?: `0x${string}` | undefined;
1497
+ } | undefined, {
1498
+ priceInFri?: FieldElement | undefined;
1499
+ priceInWei?: FieldElement | undefined;
1500
+ } | undefined>;
1491
1501
  }>;
1492
1502
  type BlockHeader = Readonly<CodecType<typeof BlockHeader>>;
1493
1503
  /** Transaction metadata.
@@ -4749,6 +4759,10 @@ declare const Block: MessageCodec<{
4749
4759
  priceInWei?: `0x${string}` | undefined;
4750
4760
  };
4751
4761
  l1DataAvailabilityMode: "unknown" | "blob" | "calldata";
4762
+ l2GasPrice?: {
4763
+ priceInFri?: `0x${string}` | undefined;
4764
+ priceInWei?: `0x${string}` | undefined;
4765
+ } | undefined;
4752
4766
  }, {
4753
4767
  blockHash?: FieldElement | undefined;
4754
4768
  parentBlockHash?: FieldElement | undefined;
@@ -4766,6 +4780,10 @@ declare const Block: MessageCodec<{
4766
4780
  priceInWei?: FieldElement | undefined;
4767
4781
  } | undefined;
4768
4782
  l1DataAvailabilityMode?: L1DataAvailabilityMode$1 | undefined;
4783
+ l2GasPrice?: {
4784
+ priceInFri?: FieldElement | undefined;
4785
+ priceInWei?: FieldElement | undefined;
4786
+ } | undefined;
4769
4787
  } | undefined>;
4770
4788
  transactions: Codec<readonly {
4771
4789
  filterIds: readonly number[];
@@ -6190,6 +6208,10 @@ declare const StarknetStream: StreamConfig<Readonly<{
6190
6208
  priceInWei?: `0x${string}` | undefined;
6191
6209
  };
6192
6210
  l1DataAvailabilityMode: "unknown" | "blob" | "calldata";
6211
+ l2GasPrice?: {
6212
+ priceInFri?: `0x${string}` | undefined;
6213
+ priceInWei?: `0x${string}` | undefined;
6214
+ } | undefined;
6193
6215
  };
6194
6216
  transactions: readonly {
6195
6217
  filterIds: readonly number[];
package/dist/index.d.ts CHANGED
@@ -123,6 +123,8 @@ interface BlockHeader$1 {
123
123
  readonly l1DataGasPrice?: ResourcePrice$1 | undefined;
124
124
  /** L1 data availability mode. */
125
125
  readonly l1DataAvailabilityMode?: L1DataAvailabilityMode$1 | undefined;
126
+ /** Price of L2 gas in the block. */
127
+ readonly l2GasPrice?: ResourcePrice$1 | undefined;
126
128
  }
127
129
  declare const BlockHeader$1: {
128
130
  encode(message: BlockHeader$1, writer?: _m0.Writer): _m0.Writer;
@@ -1464,6 +1466,7 @@ type DataAvailabilityMode = CodecType<typeof DataAvailabilityMode>;
1464
1466
  * @prop l1GasPrice Calldata gas price.
1465
1467
  * @prop l1DataGasPrice Blob gas price.
1466
1468
  * @prop l1DataAvailabilityMode How data is posted to L1.
1469
+ * @prop l2GasPrice L2 gas price.
1467
1470
  */
1468
1471
  declare const BlockHeader: MessageCodec<{
1469
1472
  blockHash: Codec<`0x${string}` | undefined, FieldElement | undefined>;
@@ -1488,6 +1491,13 @@ declare const BlockHeader: MessageCodec<{
1488
1491
  priceInWei?: FieldElement | undefined;
1489
1492
  } | undefined>;
1490
1493
  l1DataAvailabilityMode: Codec<"unknown", L1DataAvailabilityMode$1 | undefined> | Codec<"blob", L1DataAvailabilityMode$1 | undefined> | Codec<"calldata", L1DataAvailabilityMode$1 | undefined>;
1494
+ l2GasPrice: Codec<{
1495
+ priceInFri?: `0x${string}` | undefined;
1496
+ priceInWei?: `0x${string}` | undefined;
1497
+ } | undefined, {
1498
+ priceInFri?: FieldElement | undefined;
1499
+ priceInWei?: FieldElement | undefined;
1500
+ } | undefined>;
1491
1501
  }>;
1492
1502
  type BlockHeader = Readonly<CodecType<typeof BlockHeader>>;
1493
1503
  /** Transaction metadata.
@@ -4749,6 +4759,10 @@ declare const Block: MessageCodec<{
4749
4759
  priceInWei?: `0x${string}` | undefined;
4750
4760
  };
4751
4761
  l1DataAvailabilityMode: "unknown" | "blob" | "calldata";
4762
+ l2GasPrice?: {
4763
+ priceInFri?: `0x${string}` | undefined;
4764
+ priceInWei?: `0x${string}` | undefined;
4765
+ } | undefined;
4752
4766
  }, {
4753
4767
  blockHash?: FieldElement | undefined;
4754
4768
  parentBlockHash?: FieldElement | undefined;
@@ -4766,6 +4780,10 @@ declare const Block: MessageCodec<{
4766
4780
  priceInWei?: FieldElement | undefined;
4767
4781
  } | undefined;
4768
4782
  l1DataAvailabilityMode?: L1DataAvailabilityMode$1 | undefined;
4783
+ l2GasPrice?: {
4784
+ priceInFri?: FieldElement | undefined;
4785
+ priceInWei?: FieldElement | undefined;
4786
+ } | undefined;
4769
4787
  } | undefined>;
4770
4788
  transactions: Codec<readonly {
4771
4789
  filterIds: readonly number[];
@@ -6190,6 +6208,10 @@ declare const StarknetStream: StreamConfig<Readonly<{
6190
6208
  priceInWei?: `0x${string}` | undefined;
6191
6209
  };
6192
6210
  l1DataAvailabilityMode: "unknown" | "blob" | "calldata";
6211
+ l2GasPrice?: {
6212
+ priceInFri?: `0x${string}` | undefined;
6213
+ priceInWei?: `0x${string}` | undefined;
6214
+ } | undefined;
6193
6215
  };
6194
6216
  transactions: readonly {
6195
6217
  filterIds: readonly number[];
package/dist/index.mjs CHANGED
@@ -659,7 +659,8 @@ function createBaseBlockHeader() {
659
659
  starknetVersion: "",
660
660
  l1GasPrice: void 0,
661
661
  l1DataGasPrice: void 0,
662
- l1DataAvailabilityMode: 0
662
+ l1DataAvailabilityMode: 0,
663
+ l2GasPrice: void 0
663
664
  };
664
665
  }
665
666
  const BlockHeader$1 = {
@@ -697,6 +698,9 @@ const BlockHeader$1 = {
697
698
  if (message.l1DataAvailabilityMode !== void 0 && message.l1DataAvailabilityMode !== 0) {
698
699
  writer.uint32(80).int32(message.l1DataAvailabilityMode);
699
700
  }
701
+ if (message.l2GasPrice !== void 0) {
702
+ ResourcePrice$1.encode(message.l2GasPrice, writer.uint32(90).fork()).ldelim();
703
+ }
700
704
  return writer;
701
705
  },
702
706
  decode(input, length) {
@@ -766,6 +770,12 @@ const BlockHeader$1 = {
766
770
  }
767
771
  message.l1DataAvailabilityMode = reader.int32();
768
772
  continue;
773
+ case 11:
774
+ if (tag !== 90) {
775
+ break;
776
+ }
777
+ message.l2GasPrice = ResourcePrice$1.decode(reader, reader.uint32());
778
+ continue;
769
779
  }
770
780
  if ((tag & 7) === 4 || tag === 0) {
771
781
  break;
@@ -785,7 +795,8 @@ const BlockHeader$1 = {
785
795
  starknetVersion: isSet$1(object.starknetVersion) ? globalThis.String(object.starknetVersion) : "",
786
796
  l1GasPrice: isSet$1(object.l1GasPrice) ? ResourcePrice$1.fromJSON(object.l1GasPrice) : void 0,
787
797
  l1DataGasPrice: isSet$1(object.l1DataGasPrice) ? ResourcePrice$1.fromJSON(object.l1DataGasPrice) : void 0,
788
- l1DataAvailabilityMode: isSet$1(object.l1DataAvailabilityMode) ? l1DataAvailabilityModeFromJSON(object.l1DataAvailabilityMode) : 0
798
+ l1DataAvailabilityMode: isSet$1(object.l1DataAvailabilityMode) ? l1DataAvailabilityModeFromJSON(object.l1DataAvailabilityMode) : 0,
799
+ l2GasPrice: isSet$1(object.l2GasPrice) ? ResourcePrice$1.fromJSON(object.l2GasPrice) : void 0
789
800
  };
790
801
  },
791
802
  toJSON(message) {
@@ -820,6 +831,9 @@ const BlockHeader$1 = {
820
831
  if (message.l1DataAvailabilityMode !== void 0 && message.l1DataAvailabilityMode !== 0) {
821
832
  obj.l1DataAvailabilityMode = l1DataAvailabilityModeToJSON(message.l1DataAvailabilityMode);
822
833
  }
834
+ if (message.l2GasPrice !== void 0) {
835
+ obj.l2GasPrice = ResourcePrice$1.toJSON(message.l2GasPrice);
836
+ }
823
837
  return obj;
824
838
  },
825
839
  create(base) {
@@ -837,6 +851,7 @@ const BlockHeader$1 = {
837
851
  message.l1GasPrice = object.l1GasPrice !== void 0 && object.l1GasPrice !== null ? ResourcePrice$1.fromPartial(object.l1GasPrice) : void 0;
838
852
  message.l1DataGasPrice = object.l1DataGasPrice !== void 0 && object.l1DataGasPrice !== null ? ResourcePrice$1.fromPartial(object.l1DataGasPrice) : void 0;
839
853
  message.l1DataAvailabilityMode = object.l1DataAvailabilityMode ?? 0;
854
+ message.l2GasPrice = object.l2GasPrice !== void 0 && object.l2GasPrice !== null ? ResourcePrice$1.fromPartial(object.l2GasPrice) : void 0;
840
855
  return message;
841
856
  }
842
857
  };
@@ -7717,7 +7732,8 @@ const BlockHeader = MessageCodec({
7717
7732
  starknetVersion: RequiredCodec(StringCodec),
7718
7733
  l1GasPrice: RequiredCodec(ResourcePrice),
7719
7734
  l1DataGasPrice: RequiredCodec(ResourcePrice),
7720
- l1DataAvailabilityMode: RequiredCodec(L1DataAvailabilityMode)
7735
+ l1DataAvailabilityMode: RequiredCodec(L1DataAvailabilityMode),
7736
+ l2GasPrice: OptionalCodec(ResourcePrice)
7721
7737
  });
7722
7738
  const TransactionMeta = MessageCodec({
7723
7739
  transactionIndex: RequiredCodec(NumberCodec),