@apibara/beaconchain 2.0.1-beta.9 → 2.1.0-beta.2
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.cjs +62 -55
- package/dist/index.d.cts +307 -286
- package/dist/index.d.mts +307 -286
- package/dist/index.d.ts +307 -286
- package/dist/index.mjs +63 -57
- package/package.json +3 -3
- package/src/block.ts +56 -47
package/dist/index.cjs
CHANGED
|
@@ -1087,7 +1087,7 @@ const Transaction$1 = {
|
|
|
1087
1087
|
writer.uint32(98).bytes(message.input);
|
|
1088
1088
|
}
|
|
1089
1089
|
if (message.signature !== void 0) {
|
|
1090
|
-
Signature.encode(message.signature, writer.uint32(106).fork()).ldelim();
|
|
1090
|
+
Signature$1.encode(message.signature, writer.uint32(106).fork()).ldelim();
|
|
1091
1091
|
}
|
|
1092
1092
|
if (message.chainId !== void 0) {
|
|
1093
1093
|
if (BigInt.asUintN(64, message.chainId) !== message.chainId) {
|
|
@@ -1206,7 +1206,7 @@ const Transaction$1 = {
|
|
|
1206
1206
|
if (tag !== 106) {
|
|
1207
1207
|
break;
|
|
1208
1208
|
}
|
|
1209
|
-
message.signature = Signature.decode(reader, reader.uint32());
|
|
1209
|
+
message.signature = Signature$1.decode(reader, reader.uint32());
|
|
1210
1210
|
continue;
|
|
1211
1211
|
case 14:
|
|
1212
1212
|
if (tag !== 112) {
|
|
@@ -1260,7 +1260,7 @@ const Transaction$1 = {
|
|
|
1260
1260
|
maxFeePerGas: isSet$1(object.maxFeePerGas) ? U128.fromJSON(object.maxFeePerGas) : void 0,
|
|
1261
1261
|
maxPriorityFeePerGas: isSet$1(object.maxPriorityFeePerGas) ? U128.fromJSON(object.maxPriorityFeePerGas) : void 0,
|
|
1262
1262
|
input: isSet$1(object.input) ? bytesFromBase64(object.input) : new Uint8Array(0),
|
|
1263
|
-
signature: isSet$1(object.signature) ? Signature.fromJSON(object.signature) : void 0,
|
|
1263
|
+
signature: isSet$1(object.signature) ? Signature$1.fromJSON(object.signature) : void 0,
|
|
1264
1264
|
chainId: isSet$1(object.chainId) ? BigInt(object.chainId) : void 0,
|
|
1265
1265
|
accessList: globalThis.Array.isArray(object?.accessList) ? object.accessList.map((e) => AccessListItem.fromJSON(e)) : [],
|
|
1266
1266
|
transactionType: isSet$1(object.transactionType) ? BigInt(object.transactionType) : BigInt("0"),
|
|
@@ -1307,7 +1307,7 @@ const Transaction$1 = {
|
|
|
1307
1307
|
obj.input = base64FromBytes(message.input);
|
|
1308
1308
|
}
|
|
1309
1309
|
if (message.signature !== void 0) {
|
|
1310
|
-
obj.signature = Signature.toJSON(message.signature);
|
|
1310
|
+
obj.signature = Signature$1.toJSON(message.signature);
|
|
1311
1311
|
}
|
|
1312
1312
|
if (message.chainId !== void 0) {
|
|
1313
1313
|
obj.chainId = message.chainId.toString();
|
|
@@ -1343,7 +1343,7 @@ const Transaction$1 = {
|
|
|
1343
1343
|
message.maxFeePerGas = object.maxFeePerGas !== void 0 && object.maxFeePerGas !== null ? U128.fromPartial(object.maxFeePerGas) : void 0;
|
|
1344
1344
|
message.maxPriorityFeePerGas = object.maxPriorityFeePerGas !== void 0 && object.maxPriorityFeePerGas !== null ? U128.fromPartial(object.maxPriorityFeePerGas) : void 0;
|
|
1345
1345
|
message.input = object.input ?? new Uint8Array(0);
|
|
1346
|
-
message.signature = object.signature !== void 0 && object.signature !== null ? Signature.fromPartial(object.signature) : void 0;
|
|
1346
|
+
message.signature = object.signature !== void 0 && object.signature !== null ? Signature$1.fromPartial(object.signature) : void 0;
|
|
1347
1347
|
message.chainId = object.chainId ?? void 0;
|
|
1348
1348
|
message.accessList = object.accessList?.map((e) => AccessListItem.fromPartial(e)) || [];
|
|
1349
1349
|
message.transactionType = object.transactionType ?? BigInt("0");
|
|
@@ -1954,7 +1954,7 @@ const ExecutionPayload$1 = {
|
|
|
1954
1954
|
function createBaseSignature() {
|
|
1955
1955
|
return { r: void 0, s: void 0 };
|
|
1956
1956
|
}
|
|
1957
|
-
const Signature = {
|
|
1957
|
+
const Signature$1 = {
|
|
1958
1958
|
encode(message, writer = _m0__default.Writer.create()) {
|
|
1959
1959
|
if (message.r !== void 0) {
|
|
1960
1960
|
U256.encode(message.r, writer.uint32(10).fork()).ldelim();
|
|
@@ -2008,7 +2008,7 @@ const Signature = {
|
|
|
2008
2008
|
return obj;
|
|
2009
2009
|
},
|
|
2010
2010
|
create(base) {
|
|
2011
|
-
return Signature.fromPartial(base ?? {});
|
|
2011
|
+
return Signature$1.fromPartial(base ?? {});
|
|
2012
2012
|
},
|
|
2013
2013
|
fromPartial(object) {
|
|
2014
2014
|
const message = createBaseSignature();
|
|
@@ -2145,7 +2145,7 @@ const data = {
|
|
|
2145
2145
|
Block: Block$1,
|
|
2146
2146
|
BlockHeader: BlockHeader$1,
|
|
2147
2147
|
ExecutionPayload: ExecutionPayload$1,
|
|
2148
|
-
Signature: Signature,
|
|
2148
|
+
Signature: Signature$1,
|
|
2149
2149
|
Transaction: Transaction$1,
|
|
2150
2150
|
Validator: Validator$1,
|
|
2151
2151
|
protobufPackage: protobufPackage$1
|
|
@@ -2653,75 +2653,81 @@ const B384 = schema.Schema.transform(B384Proto, _B384, {
|
|
|
2653
2653
|
});
|
|
2654
2654
|
|
|
2655
2655
|
const ExecutionPayload = schema.Schema.Struct({
|
|
2656
|
-
parentHash:
|
|
2657
|
-
feeRecipient:
|
|
2658
|
-
stateRoot:
|
|
2659
|
-
receiptsRoot:
|
|
2656
|
+
parentHash: evm.B256,
|
|
2657
|
+
feeRecipient: evm.Address,
|
|
2658
|
+
stateRoot: evm.B256,
|
|
2659
|
+
receiptsRoot: evm.B256,
|
|
2660
2660
|
logsBloom: protocol.BytesFromUint8Array,
|
|
2661
|
-
prevRandao:
|
|
2662
|
-
blockNumber: schema.Schema.
|
|
2663
|
-
timestamp: schema.Schema.
|
|
2661
|
+
prevRandao: evm.B256,
|
|
2662
|
+
blockNumber: schema.Schema.BigIntFromSelf,
|
|
2663
|
+
timestamp: schema.Schema.DateFromSelf
|
|
2664
2664
|
});
|
|
2665
2665
|
const BlockHeader = schema.Schema.Struct({
|
|
2666
2666
|
slot: schema.Schema.BigIntFromSelf,
|
|
2667
2667
|
proposerIndex: schema.Schema.Number,
|
|
2668
|
-
parentRoot:
|
|
2669
|
-
stateRoot:
|
|
2668
|
+
parentRoot: evm.B256,
|
|
2669
|
+
stateRoot: evm.B256,
|
|
2670
2670
|
randaoReveal: protocol.BytesFromUint8Array,
|
|
2671
|
-
depositCount: schema.Schema.
|
|
2672
|
-
depositRoot:
|
|
2673
|
-
blockHash:
|
|
2674
|
-
graffiti:
|
|
2671
|
+
depositCount: schema.Schema.BigIntFromSelf,
|
|
2672
|
+
depositRoot: evm.B256,
|
|
2673
|
+
blockHash: evm.B256,
|
|
2674
|
+
graffiti: evm.B256,
|
|
2675
2675
|
executionPayload: schema.Schema.optional(ExecutionPayload),
|
|
2676
|
-
blobKzgCommitments: schema.Schema.
|
|
2676
|
+
blobKzgCommitments: schema.Schema.Array(B384)
|
|
2677
2677
|
});
|
|
2678
2678
|
const Validator = schema.Schema.Struct({
|
|
2679
|
-
filterIds: schema.Schema.
|
|
2680
|
-
validatorIndex: schema.Schema.
|
|
2681
|
-
balance: schema.Schema.
|
|
2682
|
-
status:
|
|
2683
|
-
pubkey:
|
|
2684
|
-
withdrawalCredentials:
|
|
2685
|
-
effectiveBalance: schema.Schema.
|
|
2686
|
-
slashed: schema.Schema.
|
|
2687
|
-
activationEligibilityEpoch: schema.Schema.
|
|
2688
|
-
activationEpoch: schema.Schema.
|
|
2689
|
-
exitEpoch: schema.Schema.
|
|
2690
|
-
withdrawableEpoch: schema.Schema.
|
|
2679
|
+
filterIds: schema.Schema.Array(schema.Schema.Number),
|
|
2680
|
+
validatorIndex: schema.Schema.Number,
|
|
2681
|
+
balance: schema.Schema.BigIntFromSelf,
|
|
2682
|
+
status: ValidatorStatus,
|
|
2683
|
+
pubkey: B384,
|
|
2684
|
+
withdrawalCredentials: evm.B256,
|
|
2685
|
+
effectiveBalance: schema.Schema.BigIntFromSelf,
|
|
2686
|
+
slashed: schema.Schema.Boolean,
|
|
2687
|
+
activationEligibilityEpoch: schema.Schema.BigIntFromSelf,
|
|
2688
|
+
activationEpoch: schema.Schema.BigIntFromSelf,
|
|
2689
|
+
exitEpoch: schema.Schema.BigIntFromSelf,
|
|
2690
|
+
withdrawableEpoch: schema.Schema.BigIntFromSelf
|
|
2691
2691
|
});
|
|
2692
2692
|
const Blob = schema.Schema.Struct({
|
|
2693
|
-
filterIds: schema.Schema.
|
|
2694
|
-
blobIndex: schema.Schema.
|
|
2695
|
-
blob: schema.Schema.
|
|
2696
|
-
kzgCommitment:
|
|
2697
|
-
kzgProof:
|
|
2698
|
-
kzgCommitmentInclusionProof: schema.Schema.
|
|
2699
|
-
blobHash:
|
|
2700
|
-
transactionIndex: schema.Schema.
|
|
2701
|
-
transactionHash:
|
|
2693
|
+
filterIds: schema.Schema.Array(schema.Schema.Number),
|
|
2694
|
+
blobIndex: schema.Schema.Number,
|
|
2695
|
+
blob: schema.Schema.Uint8ArrayFromSelf,
|
|
2696
|
+
kzgCommitment: B384,
|
|
2697
|
+
kzgProof: B384,
|
|
2698
|
+
kzgCommitmentInclusionProof: schema.Schema.Array(evm.B256),
|
|
2699
|
+
blobHash: evm.B256,
|
|
2700
|
+
transactionIndex: schema.Schema.Number,
|
|
2701
|
+
transactionHash: evm.B256
|
|
2702
|
+
});
|
|
2703
|
+
const Signature = schema.Schema.Struct({
|
|
2704
|
+
r: schema.Schema.optional(evm.U256),
|
|
2705
|
+
s: schema.Schema.optional(evm.U256),
|
|
2706
|
+
v: schema.Schema.optional(evm.U256),
|
|
2707
|
+
YParity: schema.Schema.optional(schema.Schema.Boolean)
|
|
2702
2708
|
});
|
|
2703
2709
|
const Transaction = schema.Schema.Struct({
|
|
2704
|
-
filterIds: schema.Schema.
|
|
2705
|
-
transactionHash:
|
|
2706
|
-
nonce: schema.Schema.
|
|
2707
|
-
transactionIndex: schema.Schema.
|
|
2708
|
-
from:
|
|
2710
|
+
filterIds: schema.Schema.Array(schema.Schema.Number),
|
|
2711
|
+
transactionHash: evm.B256,
|
|
2712
|
+
nonce: schema.Schema.BigIntFromSelf,
|
|
2713
|
+
transactionIndex: schema.Schema.Number,
|
|
2714
|
+
from: evm.Address,
|
|
2709
2715
|
to: schema.Schema.optional(evm.Address),
|
|
2710
|
-
value:
|
|
2716
|
+
value: evm.U256,
|
|
2711
2717
|
gasPrice: schema.Schema.optional(evm.U128),
|
|
2712
2718
|
gasLimit: schema.Schema.optional(evm.U128),
|
|
2713
2719
|
maxFeePerGas: schema.Schema.optional(evm.U128),
|
|
2714
2720
|
maxPriorityFeePerGas: schema.Schema.optional(evm.U128),
|
|
2715
|
-
input: schema.Schema.
|
|
2716
|
-
signature: schema.Schema.optional(
|
|
2721
|
+
input: schema.Schema.Uint8ArrayFromSelf,
|
|
2722
|
+
signature: schema.Schema.optional(Signature),
|
|
2717
2723
|
chainId: schema.Schema.optional(schema.Schema.BigIntFromSelf),
|
|
2718
|
-
accessList: schema.Schema.
|
|
2719
|
-
transactionType: schema.Schema.
|
|
2724
|
+
accessList: schema.Schema.Array(evm.AccessListItem),
|
|
2725
|
+
transactionType: schema.Schema.BigIntFromSelf,
|
|
2720
2726
|
maxFeePerBlobGas: schema.Schema.optional(evm.U128),
|
|
2721
|
-
blobVersionedHashes: schema.Schema.
|
|
2727
|
+
blobVersionedHashes: schema.Schema.Array(evm.B256)
|
|
2722
2728
|
});
|
|
2723
2729
|
const Block = schema.Schema.Struct({
|
|
2724
|
-
header:
|
|
2730
|
+
header: BlockHeader,
|
|
2725
2731
|
validators: schema.Schema.Array(Validator),
|
|
2726
2732
|
blobs: schema.Schema.Array(Blob),
|
|
2727
2733
|
transactions: schema.Schema.Array(Transaction)
|
|
@@ -2859,6 +2865,7 @@ exports.ExecutionPayload = ExecutionPayload;
|
|
|
2859
2865
|
exports.Filter = Filter;
|
|
2860
2866
|
exports.FilterFromBytes = FilterFromBytes;
|
|
2861
2867
|
exports.HeaderFilter = HeaderFilter;
|
|
2868
|
+
exports.Signature = Signature;
|
|
2862
2869
|
exports.Transaction = Transaction;
|
|
2863
2870
|
exports.TransactionFilter = TransactionFilter;
|
|
2864
2871
|
exports.Validator = Validator;
|