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

TransactionReceipt is missing OP Stack-specific properties #2955

Closed
1 task done
0xwetzo opened this issue Nov 2, 2024 · 3 comments
Closed
1 task done

TransactionReceipt is missing OP Stack-specific properties #2955

0xwetzo opened this issue Nov 2, 2024 · 3 comments
Labels
Good First Issue Misc: Good First Issue

Comments

@0xwetzo
Copy link

0xwetzo commented Nov 2, 2024

Check existing issues

Viem Version

2.21.38

Current Behavior

OP Stack-specific properties like l1Fee are flagged as non-existant by. the IDE.

Expected Behavior

The OP Stack-specific properties should be present in the type TransactionReceipt as they are returned by waitForTransactionReceipt and getTransactionReceipt:

  • For OP Mainnet:
        "l1Fee": "0x56dceff14c64",
        "l1FeeScalar": "1",
        "l1GasPrice": "0x339faf23b",
        "l1GasUsed": "0x1aec",
  • For Base:
        "l1BaseFeeScalar": "0x8dd",
        "l1BlobBaseFee": "0x194b19aa",
        "l1BlobBaseFeeScalar": "0x101c12",
        "l1Fee": "0x14aaf0a42e",
        "l1GasPrice": "0xa2175a98",
        "l1GasUsed": "0xa25",

Steps To Reproduce

import { createPublicClient, http } from 'viem';
import type { TransactionReceipt } from 'viem';
import { optimism } from 'viem/chains';

const client = createPublicClient({
  chain: optimism,
  transport: http(),
});

const run = async () => {
  const receipt: TransactionReceipt = await client.waitForTransactionReceipt({
    hash: '0x3f94f8d43feeaaa1ab2c16f1700f0b900fa8e0f6a47e1d94a3c94fb083389687',
  });
  console.log(receipt.l1Fee.toString());
};

run();

In this snippet, l1Fee will appear underscored in red.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/viem-getting-started-pifrph?file=index.ts

Anything else?

No response

@jxom jxom added the Good First Issue Misc: Good First Issue label Nov 3, 2024
@Chirag-S-Kotian
Copy link

assign this to me.

@insulineru
Copy link

Hey, @0xwetzo.

You can use existing type OpStackTransactionReceipt for OP-Stack specific tx receipt

image

@0xwetzo
Copy link
Author

0xwetzo commented Nov 12, 2024

Thanks a lot @insulineru, there is no mention of this type in the docs so I did not know about it.

@0xwetzo 0xwetzo closed this as completed Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Misc: Good First Issue
Projects
None yet
Development

No branches or pull requests

4 participants