Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

adding effective gas price to transactionreceipt #4694

Merged
merged 8 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -497,5 +497,6 @@ Released with 1.0.0-beta.37 code base.

### Fixed
- Fix a typo in the documentation for `methods.myMethod.send` (#4599)
- Added effectiveGasPrice to TransactionReceipt (#4692)
- Correction in documentation for `web3.eth.accounts.signTransaction` (#4576)
- Updated README to include Webpack 5 create-react-app support instructions (#4173)
4 changes: 4 additions & 0 deletions packages/web3-core-helpers/src/formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@ var outputTransactionReceiptFormatter = function (receipt) {
receipt.logs = receipt.logs.map(outputLogFormatter);
}

if (receipt.effectiveGasPrice) {
receipt.effectiveGasPrice = utils.hexToNumber(receipt.effectiveGasPrice)
}

if (receipt.contractAddress) {
receipt.contractAddress = utils.toChecksumAddress(receipt.contractAddress);
}
Expand Down
1 change: 1 addition & 0 deletions packages/web3-core/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ export interface TransactionReceipt {
contractAddress?: string;
cumulativeGasUsed: number;
gasUsed: number;
effectiveGasPrice: number;
logs: Log[];
logsBloom: string;
events?: {
Expand Down