web3dart
web3dart copied to clipboard
Add EIP4844 support
impl by dart and tested transaction detail
usage:
final eip4844 = Transaction(
to: address,
maxFeePerGas: EtherAmount.fromBigInt(EtherUnit.wei,maxFeePerGas),
maxPriorityFeePerGas:
EtherAmount.fromBigInt(EtherUnit.wei, maxPriorityFeePerGasInt),
maxGas: (gasLimit * BigInt.from(12) / BigInt.from(10)).toInt(),
maxFeePerBlobGas: EtherAmount.fromBigInt(EtherUnit.wei, blobFeeCap),
blobVersionedHashes: sidecar!.blobHashes(),
nonce: nonce,
value: EtherAmount.fromInt(EtherUnit.wei, 111),
/// kzg from https://github.com/weishirongzhen/dart_kzg_4844_util
sidecar: Sidecar(
blobs: sidecar!.blobs.map((e) => e.blob).toList(growable: false),
commitment: sidecar!.commitments
.map((e) => e.commitment)
.toList(growable: false),
proof: sidecar!.proofs.map((e) => e.proof).toList(growable: false),
),
);
final signedTx = await client.signTransaction(credentials, eip4844,
chainId: chainId.toInt());
result = await client.sendTransaction(
credentials,
eip4844,
chainId: chainId.toInt(),
);