Skip to content

Commit 077ecfd

Browse files
committed
Added l1 gas parameters to transaction receipt
Ran build scripts
1 parent 9276187 commit 077ecfd

31 files changed

+321
-32
lines changed

Diff for: dist/ethers.js

+36-3
Original file line numberDiff line numberDiff line change
@@ -14612,6 +14612,29 @@ class TransactionReceipt {
1461214612
* could be used to validate certain parts of the receipt.
1461314613
*/
1461414614
root;
14615+
/**
14616+
* The price of gas for the L1 security.
14617+
* Computed based on the base fee per gas and the blob base fee per gas of the underlying L1 chain.
14618+
*
14619+
* Only relevant for L2 optimism chains such as Optimism or Base.
14620+
* Will be 0n for L1 transaction receipts.
14621+
*/
14622+
l1GasPrice;
14623+
/**
14624+
* The amount of gas used for the L1 security.
14625+
* Computed based on the call data size.
14626+
*
14627+
* Only relevant for L2 optimism chains such as Optimism or Base.
14628+
* Will be 0n for L1 transaction receipts.
14629+
*/
14630+
l1GasUsed;
14631+
/**
14632+
* The the product of the l1GasPrice and l1GasUsed. The total fee paid for the L1 security.
14633+
*
14634+
* Only relevant for L2 optimism chains such as Optimism or Base.
14635+
* Will be 0n for L1 transaction receipts.
14636+
*/
14637+
l1Fee;
1461514638
#logs;
1461614639
/**
1461714640
* @_ignore:
@@ -14645,7 +14668,10 @@ class TransactionReceipt {
1464514668
type: tx.type,
1464614669
//byzantium: tx.byzantium,
1464714670
status: tx.status,
14648-
root: tx.root
14671+
root: tx.root,
14672+
l1Fee: tx.l1Fee,
14673+
l1GasPrice: tx.l1GasPrice,
14674+
l1GasUsed: tx.l1GasUsed,
1464914675
});
1465014676
}
1465114677
/**
@@ -14657,7 +14683,7 @@ class TransactionReceipt {
1465714683
*/
1465814684
toJSON() {
1465914685
const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium,
14660-
status, root } = this;
14686+
status, root, } = this;
1466114687
return {
1466214688
_type: "TransactionReceipt",
1466314689
blockHash, blockNumber,
@@ -14669,6 +14695,9 @@ class TransactionReceipt {
1466914695
blobGasUsed: toJson(this.blobGasUsed),
1467014696
blobGasPrice: toJson(this.blobGasPrice),
1467114697
gasUsed: toJson(this.gasUsed),
14698+
l1GasPrice: toJson(this.l1GasPrice),
14699+
l1GasUsed: toJson(this.l1GasUsed),
14700+
l1Fee: toJson(this.l1Fee),
1467214701
hash, index, logs, logsBloom, root, status, to
1467314702
};
1467414703
}
@@ -17109,7 +17138,11 @@ const _formatTransactionReceipt = object({
1710917138
effectiveGasPrice: allowNull(getBigInt),
1711017139
blobGasPrice: allowNull(getBigInt, null),
1711117140
status: allowNull(getNumber),
17112-
type: allowNull(getNumber, 0)
17141+
type: allowNull(getNumber, 0),
17142+
// l1 gas data exist only on L2 optimism chains such as Optimism or Base
17143+
l1Fee: allowNull(getBigInt, 0n),
17144+
l1GasPrice: allowNull(getBigInt, 0n),
17145+
l1GasUsed: allowNull(getBigInt, 0n),
1711317146
}, {
1711417147
effectiveGasPrice: ["gasPrice"],
1711517148
hash: ["transactionHash"],

Diff for: dist/ethers.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/ethers.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/ethers.umd.js

+36-3
Original file line numberDiff line numberDiff line change
@@ -14618,6 +14618,29 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
1461814618
* could be used to validate certain parts of the receipt.
1461914619
*/
1462014620
root;
14621+
/**
14622+
* The price of gas for the L1 security.
14623+
* Computed based on the base fee per gas and the blob base fee per gas of the underlying L1 chain.
14624+
*
14625+
* Only relevant for L2 optimism chains such as Optimism or Base.
14626+
* Will be 0n for L1 transaction receipts.
14627+
*/
14628+
l1GasPrice;
14629+
/**
14630+
* The amount of gas used for the L1 security.
14631+
* Computed based on the call data size.
14632+
*
14633+
* Only relevant for L2 optimism chains such as Optimism or Base.
14634+
* Will be 0n for L1 transaction receipts.
14635+
*/
14636+
l1GasUsed;
14637+
/**
14638+
* The the product of the l1GasPrice and l1GasUsed. The total fee paid for the L1 security.
14639+
*
14640+
* Only relevant for L2 optimism chains such as Optimism or Base.
14641+
* Will be 0n for L1 transaction receipts.
14642+
*/
14643+
l1Fee;
1462114644
#logs;
1462214645
/**
1462314646
* @_ignore:
@@ -14651,7 +14674,10 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
1465114674
type: tx.type,
1465214675
//byzantium: tx.byzantium,
1465314676
status: tx.status,
14654-
root: tx.root
14677+
root: tx.root,
14678+
l1Fee: tx.l1Fee,
14679+
l1GasPrice: tx.l1GasPrice,
14680+
l1GasUsed: tx.l1GasUsed,
1465514681
});
1465614682
}
1465714683
/**
@@ -14663,7 +14689,7 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
1466314689
*/
1466414690
toJSON() {
1466514691
const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium,
14666-
status, root } = this;
14692+
status, root, } = this;
1466714693
return {
1466814694
_type: "TransactionReceipt",
1466914695
blockHash, blockNumber,
@@ -14675,6 +14701,9 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
1467514701
blobGasUsed: toJson(this.blobGasUsed),
1467614702
blobGasPrice: toJson(this.blobGasPrice),
1467714703
gasUsed: toJson(this.gasUsed),
14704+
l1GasPrice: toJson(this.l1GasPrice),
14705+
l1GasUsed: toJson(this.l1GasUsed),
14706+
l1Fee: toJson(this.l1Fee),
1467814707
hash, index, logs, logsBloom, root, status, to
1467914708
};
1468014709
}
@@ -17115,7 +17144,11 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !==
1711517144
effectiveGasPrice: allowNull(getBigInt),
1711617145
blobGasPrice: allowNull(getBigInt, null),
1711717146
status: allowNull(getNumber),
17118-
type: allowNull(getNumber, 0)
17147+
type: allowNull(getNumber, 0),
17148+
// l1 gas data exist only on L2 optimism chains such as Optimism or Base
17149+
l1Fee: allowNull(getBigInt, 0n),
17150+
l1GasPrice: allowNull(getBigInt, 0n),
17151+
l1GasUsed: allowNull(getBigInt, 0n),
1711917152
}, {
1712017153
effectiveGasPrice: ["gasPrice"],
1712117154
hash: ["transactionHash"],

Diff for: dist/ethers.umd.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/ethers.umd.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: lib.commonjs/providers/format.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

Diff for: lib.commonjs/providers/format.js

+5-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)