You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+15-15
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
# Contributing
2
2
3
-
Thank you for contributing to web3.js! We appreciate your interest and welcome any contributions that can help improve our documentation, functionality, addressing bugs, or any other aspects that can contribute to the overall improvement of our project. Before you start contributing, please take a moment to review the guidelines below.
3
+
Thank you for contributing to Web3.js! We appreciate your interest and welcome any contributions that can help improve our documentation, functionality, address bugs, or any other aspects that can contribute to the overall improvement of our project. Before you start contributing, please take a moment to review the guidelines below.
4
4
5
5
## Help and Support
6
6
7
-
If you face any issues while contributing, or you want any type of support, we encourage you to join our [Discord Community](https://discord.com/invite/3shNX8cqGR) and ask any question in the `#web3js-general` channel, and/or submit a [New Issue](https://github.com/web3/web3.js/issues/new).
7
+
If you face any issues while contributing or want any type of support, we encourage you to join our [Discord Community](https://discord.com/invite/3shNX8cqGR), ask any question in the `#web3js-general` channel, and/or submit a [new issue](https://github.com/web3/web3.js/issues/new).
8
8
9
9
## Prerequisites
10
10
@@ -15,12 +15,12 @@ If you face any issues while contributing, or you want any type of support, we e
15
15
16
16
1.**Fork the docs:** Start by forking our repository to your GitHub account.
17
17
18
-
2.**Clone the repo:** Clone the forked repository to your local machine using the following command
18
+
2.**Clone the repo:** Clone the forked repository to your local machine using the following command:
3.**Create a Branch:** Create a new branch for your changes with a descriptive name.
23
-
**NOTE: The branch name must include the issue number (if there is no issue created for your contribution, please create one)**
23
+
**NOTE: The branch name must include the issue number (if there is no issue created for your contribution, please create one).**
24
24
```bash
25
25
git checkout -b issue-name-1234
26
26
```
@@ -32,7 +32,7 @@ yarn
32
32
```
33
33
6.**Make your changes:**...
34
34
35
-
7. Check changes in local environment: Run the command `yarn start` and you'll see a local environment in `localhost:3000` with the docs
35
+
7. Check changes in the local environment: Run the command `yarn start` and you'll see a local environment in `localhost:3000` with the documents.
36
36
37
37
8.**Commit your changes:**`git add .` and `git commit -m 'descriptive msg'`
38
38
@@ -41,9 +41,9 @@ yarn
41
41
git push origin branch-name
42
42
```
43
43
44
-
10.**Open a Pull request(PR):** Provide a detailed description of your changes, the problem you are solving, and any additional context(you can use the PR template).
44
+
10.**Open a Pull Request (PR):** Provide a detailed description of your changes, the problem you are solving, and any additional context(you can use the PR template).
45
45
46
-
11.**Wait for review**: Before merging any branch into the main branch, it must be approved by 2 devs, after succesfully approved, you can `Squash and merge` your branch, Please be responsive to any feedback on your pull request and make necessary changes based on the review.
46
+
11.**Wait for review**: Before merging any branch into the main branch, it must be approved by two devs, after it is successfully approved, you can `Squash and merge` your branch, Please be responsive to any feedback on your pull request and make necessary changes based on the review.
47
47
48
48
## Guidelines for Pull Requests and Releases (Web3 4.x)
49
49
@@ -54,25 +54,25 @@ that **Web3 not break**.
54
54
### Pull Requests for substantive changes (e.g. everything except comments and docs)
55
55
56
56
1. Any PR that introduces a logic change should include tests. (In many cases, the tests will take more time to write than the actual code).
57
-
1. All PRs should sit for 72 hours with the `pleasereview` tag in order to garner feedback.
57
+
1. All PRs should sit for 72 hours with the `please review` tag to garner feedback.
58
58
1. No PR should be merged until it has been reviewed, passes CI, and all reviews' comments are
59
59
addressed.
60
60
1. PRs should:
61
61
1. have a narrow, well-defined focus.
62
62
1. make the smallest set of changes possible to achieve their goal.
63
63
1. include a clear description in the opening comment.
64
64
1. preserve the conventions and stylistic consistency of any files they modify.
65
-
1. Given the choice between a conservative change that mostly works and an adventurous change which seems better but introduces uncertainty - prefer the conservative change.
65
+
1. Given the choice between a conservative change that mostly works and an adventurous change that seems better but introduces uncertainty - prefer the conservative change.
66
66
67
67
### Reviews
68
68
69
-
The end goal of review is to suggest useful improvements to the author. Reviews should finish with approval unless there are issues that would result in:
69
+
The end goal of the review is to suggest useful improvements to the author. Reviews should finish with approval unless there are issues that would result in:
Copy file name to clipboardExpand all lines: docs/docs/guides/web3_providers_guide/eip6963.md
+12-3
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,11 @@ sidebar_label: 'EIP-6963: Multi Injected Provider Discovery'
9
9
10
10
EIP-6963 proposes the "Multi Injected Provider Discovery" standard, which aims to enhance the discoverability and interaction with multiple injected Ethereum providers in a browser environment. Injected providers refer to browser extensions or other injected scripts that provide access to an Ethereum provider within the context of a web application.
11
11
12
-
Web3.js library has utility function for discovery of injected providers using `requestEIP6963Providers()`function. When `requestEIP6963Providers()` is used it returns `eip6963Providers` Map object. This Map object is in global scope so every time `requestEIP6963Providers()` function is called it will update Map object and return it.
12
+
Web3.js library has utility functions for discovery of injected providers using `requestEIP6963Providers()`and `onNewProviderDiscovered(eventDetails)`.
13
13
14
-
`eip6963Providers` Map object has provider's `UUID` as keys and `EIP6963ProviderDetail` as values. `EIP6963ProviderDetail` is:
14
+
`onNewProviderDiscovered(eventDetails)` can be used to subscribe to events of provider discovery & providers map update and `requestEIP6963Providers()` returns Promise object that resolves to `Map<string, EIP6963ProviderDetail>` object containing list of providers. For updated providers `eip6963:providersMapUpdated` event is emitted and it has updated Map object. This event can be subscribed as mentioned earlier using `onNewProviderDiscovered(eventDetails)`
15
+
16
+
`eip6963ProvidersMap` object has provider's `UUID` as keys and `EIP6963ProviderDetail` as values. `EIP6963ProviderDetail` is:
15
17
16
18
```ts
17
19
exportinterfaceEIP6963ProviderDetail {
@@ -40,8 +42,15 @@ Following code snippet demonstrates usage of `requestEIP6963Providers()` functio
40
42
41
43
import { Web3 } from'web3';
42
44
43
-
const providers =Web3.requestEIP6963Providers();
45
+
// Following will subscribe to event that will be triggered when providers map is updated.
46
+
47
+
Web3.onNewProviderDiscovered((provider) => {
48
+
console.log(provider.detail); // This will log the populated providers map object, provider.detail has Map of all providers yet discovered
49
+
// add logic here for updating UI of your DApp
50
+
});
44
51
52
+
// Call the function and wait for the promise to resolve
53
+
let providers =awaitWeb3.requestEIP6963Providers();
0 commit comments