Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EIP4844 support #149

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add EIP4844 support #149

wants to merge 2 commits into from

Conversation

gtmickey
Copy link

refer from java version

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(),
    );

@xclud
Copy link
Owner

xclud commented Jun 19, 2024

Thanks for the great job. Please do not modify the version in pubspec.yml. I will merge immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants