-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export EIP-6963 Types #7270
base: 4.x
Are you sure you want to change the base?
Export EIP-6963 Types #7270
Conversation
Bundle StatsHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger
Smaller
Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
Benchmark suite | Current: 6a88b18 | Previous: cc99825 | Ratio |
---|---|---|---|
processingTx |
21330 ops/sec (±7.11% ) |
21879 ops/sec (±7.68% ) |
1.03 |
processingContractDeploy |
40367 ops/sec (±5.65% ) |
38811 ops/sec (±6.95% ) |
0.96 |
processingContractMethodSend |
15424 ops/sec (±9.24% ) |
15153 ops/sec (±7.20% ) |
0.98 |
processingContractMethodCall |
28177 ops/sec (±6.48% ) |
27291 ops/sec (±6.06% ) |
0.97 |
abiEncode |
43535 ops/sec (±7.97% ) |
41796 ops/sec (±7.77% ) |
0.96 |
abiDecode |
30704 ops/sec (±8.16% ) |
28813 ops/sec (±7.30% ) |
0.94 |
sign |
1507 ops/sec (±3.04% ) |
1512 ops/sec (±0.76% ) |
1.00 |
verify |
367 ops/sec (±0.53% ) |
359 ops/sec (±0.56% ) |
0.98 |
This comment was automatically generated by workflow using github-action-benchmark.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 4.x #7270 +/- ##
=======================================
Coverage 94.44% 94.44%
=======================================
Files 216 216
Lines 8463 8463
Branches 2339 2339
=======================================
Hits 7993 7993
Misses 470 470
Flags with carried forward coverage won't be shown. Click here to find out more. |
export interface EIP6963ProviderInfo { | ||
uuid: string; | ||
name: string; | ||
icon: string; | ||
rdns: string; | ||
} | ||
|
||
export interface EIP6963ProviderDetail<API = Web3APISpec> { | ||
info: EIP6963ProviderInfo; | ||
provider: EIP1193Provider<API>; | ||
} | ||
|
||
export type EIP6963ProviderResponse = Map<string, EIP6963ProviderDetail>; | ||
|
||
export interface EIP6963ProvidersMapUpdateEvent extends CustomEvent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why these types are moved from web3 to types package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I think they should be exported and it seemed like the best way to go about it. I can modify the PR export them directly from the web3
package, but this seemed like a better approach to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usually we move types in web3-types package if these are used by 1+ package / are common types.
As web3-types package is a dependency of almost all other packages so we try to keep it light for usecase of other individual packages usage.
( same for utils package , for future changes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe since we created web3-types, it should encompass all the neccesary types to use the package. I think as well remain consistent, as we have EIP1193Provider types EIP6693 provider types should be included. This will allow these types to be exported through the main package which would make alot of since for most users, as I believe not very many users would know that EIP6693 types would be exported through providers namespace. We had a discussion on this a while back on this issue about doing this change #6952
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also EIP-6963 types are exported under provider namespace:
export * from './web3_eip6963.js'; |
web3.js/packages/web3/src/index.ts
Line 353 in 6f9a485
export * as providers from './providers.exports.js'; |
but I think we may also export directly
Closes #6952 |
93cbb36
to
6a88b18
Compare
Export EIP-6963 types