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 L1 Security gas parameters to transaction receipt #4764

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 null 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 null 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 null 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, null),
l1GasPrice: allowNull(getBigInt, null),
l1GasUsed: allowNull(getBigInt, null),
}, {
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 null 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 null 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 null 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, null),
l1GasPrice: allowNull(getBigInt, null),
l1GasUsed: allowNull(getBigInt, null),
}, {
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