Skip to content

Commit

Permalink
Added l1 gas parameters to transaction receipt
Browse files Browse the repository at this point in the history
Ran build scripts
  • Loading branch information
maxandron committed Nov 12, 2024
1 parent 9276187 commit 077ecfd
Show file tree
Hide file tree
Showing 31 changed files with 321 additions and 32 deletions.
39 changes: 36 additions & 3 deletions dist/ethers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14612,6 +14612,29 @@ class TransactionReceipt {
* could be used to validate certain parts of the receipt.
*/
root;
/**
* The price of gas for the L1 security.
* Computed based on the base fee per gas and the blob base fee per gas of the underlying L1 chain.
*
* Only relevant for L2 optimism chains such as Optimism or Base.
* Will be 0n for L1 transaction receipts.
*/
l1GasPrice;
/**
* The amount of gas used for the L1 security.
* Computed based on the call data size.
*
* Only relevant for L2 optimism chains such as Optimism or Base.
* Will be 0n for L1 transaction receipts.
*/
l1GasUsed;
/**
* The the product of the l1GasPrice and l1GasUsed. The total fee paid for the L1 security.
*
* Only relevant for L2 optimism chains such as Optimism or Base.
* Will be 0n for L1 transaction receipts.
*/
l1Fee;
#logs;
/**
* @_ignore:
Expand Down Expand Up @@ -14645,7 +14668,10 @@ class TransactionReceipt {
type: tx.type,
//byzantium: tx.byzantium,
status: tx.status,
root: tx.root
root: tx.root,
l1Fee: tx.l1Fee,
l1GasPrice: tx.l1GasPrice,
l1GasUsed: tx.l1GasUsed,
});
}
/**
Expand All @@ -14657,7 +14683,7 @@ class TransactionReceipt {
*/
toJSON() {
const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium,
status, root } = this;
status, root, } = this;
return {
_type: "TransactionReceipt",
blockHash, blockNumber,
Expand All @@ -14669,6 +14695,9 @@ class TransactionReceipt {
blobGasUsed: toJson(this.blobGasUsed),
blobGasPrice: toJson(this.blobGasPrice),
gasUsed: toJson(this.gasUsed),
l1GasPrice: toJson(this.l1GasPrice),
l1GasUsed: toJson(this.l1GasUsed),
l1Fee: toJson(this.l1Fee),
hash, index, logs, logsBloom, root, status, to
};
}
Expand Down Expand Up @@ -17109,7 +17138,11 @@ const _formatTransactionReceipt = object({
effectiveGasPrice: allowNull(getBigInt),
blobGasPrice: allowNull(getBigInt, null),
status: allowNull(getNumber),
type: allowNull(getNumber, 0)
type: allowNull(getNumber, 0),
// l1 gas data exist only on L2 optimism chains such as Optimism or Base
l1Fee: allowNull(getBigInt, 0n),
l1GasPrice: allowNull(getBigInt, 0n),
l1GasUsed: allowNull(getBigInt, 0n),
}, {
effectiveGasPrice: ["gasPrice"],
hash: ["transactionHash"],
Expand Down
2 changes: 1 addition & 1 deletion dist/ethers.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ethers.min.js

Large diffs are not rendered by default.

39 changes: 36 additions & 3 deletions dist/ethers.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -14618,6 +14618,29 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
* could be used to validate certain parts of the receipt.
*/
root;
/**
* The price of gas for the L1 security.
* Computed based on the base fee per gas and the blob base fee per gas of the underlying L1 chain.
*
* Only relevant for L2 optimism chains such as Optimism or Base.
* Will be 0n for L1 transaction receipts.
*/
l1GasPrice;
/**
* The amount of gas used for the L1 security.
* Computed based on the call data size.
*
* Only relevant for L2 optimism chains such as Optimism or Base.
* Will be 0n for L1 transaction receipts.
*/
l1GasUsed;
/**
* The the product of the l1GasPrice and l1GasUsed. The total fee paid for the L1 security.
*
* Only relevant for L2 optimism chains such as Optimism or Base.
* Will be 0n for L1 transaction receipts.
*/
l1Fee;
#logs;
/**
* @_ignore:
Expand Down Expand Up @@ -14651,7 +14674,10 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
type: tx.type,
//byzantium: tx.byzantium,
status: tx.status,
root: tx.root
root: tx.root,
l1Fee: tx.l1Fee,
l1GasPrice: tx.l1GasPrice,
l1GasUsed: tx.l1GasUsed,
});
}
/**
Expand All @@ -14663,7 +14689,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
*/
toJSON() {
const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium,
status, root } = this;
status, root, } = this;
return {
_type: "TransactionReceipt",
blockHash, blockNumber,
Expand All @@ -14675,6 +14701,9 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
blobGasUsed: toJson(this.blobGasUsed),
blobGasPrice: toJson(this.blobGasPrice),
gasUsed: toJson(this.gasUsed),
l1GasPrice: toJson(this.l1GasPrice),
l1GasUsed: toJson(this.l1GasUsed),
l1Fee: toJson(this.l1Fee),
hash, index, logs, logsBloom, root, status, to
};
}
Expand Down Expand Up @@ -17115,7 +17144,11 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
effectiveGasPrice: allowNull(getBigInt),
blobGasPrice: allowNull(getBigInt, null),
status: allowNull(getNumber),
type: allowNull(getNumber, 0)
type: allowNull(getNumber, 0),
// l1 gas data exist only on L2 optimism chains such as Optimism or Base
l1Fee: allowNull(getBigInt, 0n),
l1GasPrice: allowNull(getBigInt, 0n),
l1GasUsed: allowNull(getBigInt, 0n),
}, {
effectiveGasPrice: ["gasPrice"],
hash: ["transactionHash"],
Expand Down
2 changes: 1 addition & 1 deletion dist/ethers.umd.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ethers.umd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib.commonjs/providers/format.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion lib.commonjs/providers/format.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 077ecfd

Please sign in to comment.