ethers.js
ethers.js copied to clipboard
Add arbitrum specific fields to tx receipt type
Arbitrum adds two fields to each tx receipt, l1BlockNumber and gasUsedForL1. This commit adds them as optional to the TransactionReceipt type, and registers them as allowNull in the formatter.
Example from a local devnet:
> await p.getTransactionReceipt('0x9640ab3c8f0fa8968c15a23ff81d031b64ecae75c68c4b91f4f672c611052412')
{
to: '0x683642c22feDE752415D4793832Ab75EFdF6223c',
from: '0x683642c22feDE752415D4793832Ab75EFdF6223c',
contractAddress: null,
transactionIndex: 1,
gasUsed: BigNumber { _hex: '0x0d8dcd', _isBigNumber: true },
logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
blockHash: '0x60a72b63a7dc8a1b3bf6613718f2e72f9d412eb22af45331dcbb71c089faf178',
transactionHash: '0x9640ab3c8f0fa8968c15a23ff81d031b64ecae75c68c4b91f4f672c611052412',
logs: [],
blockNumber: 35,
confirmations: 2,
cumulativeGasUsed: BigNumber { _hex: '0x0d8dcd', _isBigNumber: true },
effectiveGasPrice: BigNumber { _hex: '0x05f5e100', _isBigNumber: true },
status: 1,
type: 2,
l1BlockNumber: 479,
gasUsedForL1: BigNumber { _hex: '0x0d3bc5', _isBigNumber: true },
byzantium: true
}
Hey there, I'm from Offchain Labs, this PR would help our users out if it's possible to be included. Thanks!
(for future reference) There is a similar issue about arbitrary transaction types here:
- https://github.com/ethers-io/ethers.js/issues/3747