Skip to content

Commit

Permalink
fix(onNewProviderDiscovered): callback-parameter (#7242)
Browse files Browse the repository at this point in the history
* fix(onNewProviderDiscovered): callback-parameter

Callback for `onNewProviderDiscovered`should have `EIP6963ProvidersMapUpdateEvent` parameter

Closes #7241

* Update Changelog

* Fix Changelog

* Remove Unnecessary Whitespace
  • Loading branch information
danforbes committed Sep 9, 2024
1 parent 973ee80 commit 27155ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2700,5 +2700,6 @@ If there are any bugs, improvements, optimizations or any new feature proposal f
#### web3

- `Web3.providers` namespace exports `type EIP6963ProviderResponse = Map<string, EIP6963ProviderDetail>`. Return type for the static `Web3.requestEIP6963Providers` is now `Promise<EIP6963ProviderResponse>`. (#7239)
- The callback function provided to the static `Web3.onNewProviderDiscovered` function expects a parameter of type `EIP6963ProvidersMapUpdateEvent` as opposed to `EIP6963AnnounceProviderEvent`. (#7242)

## [Unreleased]
2 changes: 1 addition & 1 deletion packages/web3/src/web3_eip6963.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const requestEIP6963Providers = async (): Promise<EIP6963ProviderResponse
});


export const onNewProviderDiscovered = (callback: (providerEvent: EIP6963AnnounceProviderEvent) => void) => {
export const onNewProviderDiscovered = (callback: (providerEvent: EIP6963ProvidersMapUpdateEvent) => void) => {
if (typeof window === 'undefined') {
throw new Error("window object not available, EIP-6963 is intended to be used within a browser");
}
Expand Down

1 comment on commit 27155ea

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 27155ea Previous: 973ee80 Ratio
processingTx 21492 ops/sec (±7.89%) 23117 ops/sec (±6.26%) 1.08
processingContractDeploy 40035 ops/sec (±5.14%) 40079 ops/sec (±7.66%) 1.00
processingContractMethodSend 15323 ops/sec (±10.31%) 15960 ops/sec (±9.63%) 1.04
processingContractMethodCall 28246 ops/sec (±6.49%) 28404 ops/sec (±6.43%) 1.01
abiEncode 43024 ops/sec (±7.13%) 43768 ops/sec (±7.10%) 1.02
abiDecode 29932 ops/sec (±7.74%) 30387 ops/sec (±8.42%) 1.02
sign 1509 ops/sec (±3.19%) 1499 ops/sec (±3.12%) 0.99
verify 367 ops/sec (±0.55%) 368 ops/sec (±0.59%) 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.