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

Commit b32102d

Browse files
committed
Merge branch '4.x' into ok/6746-Web3.js-Adapter-for-Wagmi-Implementation
2 parents 718b2cc + e774646 commit b32102d

File tree

21 files changed

+384
-224
lines changed

21 files changed

+384
-224
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2335,4 +2335,22 @@ If there are any bugs, improvements, optimizations or any new feature proposal f
23352335

23362336
- Fixed an issue with detecting Uint8Array (#6486)
23372337

2338+
## [4.5.0]
2339+
2340+
### Added
2341+
2342+
#### web3-utils
2343+
2344+
- Adds missing exported type `AbiItem` from 1.x to v4 for compatabiltiy (#6678)
2345+
2346+
#### web3-types
2347+
2348+
- Adds missing exported type `AbiItem` from 1.x to v4 for compatabiltiy (#6678)
2349+
2350+
### Changed
2351+
2352+
#### web3
2353+
2354+
- Dependencies updated
2355+
23382356
## [Unreleased]

packages/web3-core/test/unit/__snapshots__/web3_context.test.ts.snap

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@ exports[`Web3Context getContextObject should return correct context object 1`] =
4040
},
4141
"registeredSubscriptions": {},
4242
"requestManager": Web3RequestManager {
43-
"_emitter": EventEmitter {
43+
"_emitter": {
4444
"_events": {
4545
"BEFORE_PROVIDER_CHANGE": [Function],
4646
"PROVIDER_CHANGED": [Function],
4747
},
4848
"_eventsCount": 2,
4949
"_maxListeners": undefined,
5050
Symbol(kCapture): false,
51+
Symbol(shapeMode): false,
5152
},
5253
"_provider": HttpProvider {
5354
"clientUrl": "http://test/abc",
@@ -59,14 +60,15 @@ exports[`Web3Context getContextObject should return correct context object 1`] =
5960
"_subscriptions": Map {},
6061
"registeredSubscriptions": {},
6162
"requestManager": Web3RequestManager {
62-
"_emitter": EventEmitter {
63+
"_emitter": {
6364
"_events": {
6465
"BEFORE_PROVIDER_CHANGE": [Function],
6566
"PROVIDER_CHANGED": [Function],
6667
},
6768
"_eventsCount": 2,
6869
"_maxListeners": undefined,
6970
Symbol(kCapture): false,
71+
Symbol(shapeMode): false,
7072
},
7173
"_provider": HttpProvider {
7274
"clientUrl": "http://test/abc",

packages/web3-core/test/unit/web3_context.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,26 @@ describe('Web3Context', () => {
6969
it('should return correct context object', () => {
7070
const context = new Context1('http://test/abc');
7171

72+
// The following is because a specific property is different in node 18 than it is in node 20 and 21
73+
// So the problematic property is removed from the object and then added to ensure its presence and its location
74+
// And the snapshot is updated to reflect the change.
75+
// Once node 18 is no longer supported, this can be removed. And the snapshot need to be updated then.
76+
77+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
78+
const symbolForShapeMode = Object.getOwnPropertySymbols(
79+
(context.getContextObject().requestManager as any)._emitter,
80+
).find(s => s.description === 'shapeMode');
81+
if (symbolForShapeMode) {
82+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
83+
delete (context.getContextObject().requestManager as any)._emitter[symbolForShapeMode];
84+
}
85+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
86+
(context.getContextObject().requestManager as any)._emitter = {
87+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
88+
...(context.getContextObject().requestManager as any)._emitter,
89+
[Symbol.for('shapeMode')]: false,
90+
};
91+
7292
expect(context.getContextObject()).toMatchSnapshot();
7393
});
7494
});

packages/web3-eth/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,7 @@ Documentation:
220220
- Catch `TransactionPollingTimeoutError` was added to send transaction events (#6623)
221221

222222
## [Unreleased]
223+
224+
### Added
225+
226+
- Added `eth.getMaxPriorityFeePerGas` method (#6748)

packages/web3-eth/src/rpc_method_wrappers.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,18 @@ export async function getGasPrice<ReturnFormat extends DataFormat>(
138138
return format({ format: 'uint' }, response as Numbers, returnFormat);
139139
}
140140

141+
/**
142+
* View additional documentations here: {@link Web3Eth.getMaxPriorityFeePerGas}
143+
* @param web3Context ({@link Web3Context}) Web3 configuration object that contains things such as the provider, request manager, wallet, etc.
144+
*/
145+
export async function getMaxPriorityFeePerGas<ReturnFormat extends DataFormat>(
146+
web3Context: Web3Context<EthExecutionAPI>,
147+
returnFormat: ReturnFormat,
148+
) {
149+
const response = await ethRpcMethods.getMaxPriorityFeePerGas(web3Context.requestManager);
150+
151+
return format({ format: 'uint' }, response as Numbers, returnFormat);
152+
}
141153
/**
142154
* View additional documentations here: {@link Web3Eth.getBlockNumber}
143155
* @param web3Context ({@link Web3Context}) Web3 configuration object that contains things such as the provider, request manager, wallet, etc.

0 commit comments

Comments
 (0)