Skip to content
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

feat: tweaked error inheritence for UserRejectedRequestError & SwitchChainError #328

Merged
merged 2 commits into from
Apr 7, 2023

Conversation

jxom
Copy link
Member

@jxom jxom commented Apr 7, 2023

As UserRejectedRequestError and SwitchChainError could come from another source (not just RPC – could be WalletConnect, Coinbase SDK, etc), making it so you can pass an arbitrary cause to these errors.

@changeset-bot
Copy link

changeset-bot bot commented Apr 7, 2023

🦋 Changeset detected

Latest commit: b0d8ab8

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Apr 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
viem ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 7, 2023 3:53am
viem-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 7, 2023 3:53am

@pr-codex
Copy link

pr-codex bot commented Apr 7, 2023

Tldr

Tweaked error inheritance for UserRejectedRequestError & SwitchChainError to be more friendly with custom errors.

Detailed summary

  • Tweaked error inheritance for UserRejectedRequestError & SwitchChainError to be more friendly with custom errors.
  • Added a new change file eleven-donkeys-lay.md

@github-actions
Copy link
Contributor

github-actions bot commented Apr 7, 2023

Size Change: +43 B (0%)

Total Size: 57 kB

Filename Size Change
dist/abi.js 258 B +3 B (+1%)
dist/accounts/index.js 1.37 kB +2 B (0%)
dist/chains.js 2.03 kB +2 B (0%)
dist/chunk-MOM6LTRA.js 0 B -43.3 kB (removed) 🏆
dist/chunk-YAP7NKRV.js 0 B -414 B (removed) 🏆
dist/contract.js 440 B +3 B (+1%)
dist/ens.js 340 B +4 B (+1%)
dist/ethers.js 754 B +1 B (0%)
dist/index.js 5.54 kB +1 B (0%)
dist/public.js 458 B +2 B (0%)
dist/test.js 508 B +3 B (+1%)
dist/utils/index.js 1.2 kB +2 B (0%)
dist/wallet.js 296 B +3 B (+1%)
dist/chunk-LS5VFAOZ.js 417 B +417 B (new file) 🆕
dist/chunk-SXZBX5P6.js 43.4 kB +43.4 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
dist/window.js 67 B

compressed-size-action

@codecov
Copy link

codecov bot commented Apr 7, 2023

Codecov Report

Merging #328 (b0d8ab8) into main (cfa1224) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##             main     #328    +/-   ##
========================================
  Coverage   99.86%   99.86%            
========================================
  Files         263      263            
  Lines       16899    17016   +117     
  Branches     1805     1817    +12     
========================================
+ Hits        16876    16993   +117     
  Misses         21       21            
  Partials        2        2            
Impacted Files Coverage Δ
src/errors/request.ts 100.00% <100.00%> (ø)

... and 8 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jxom jxom merged commit ee87fe7 into main Apr 7, 2023
@jxom jxom deleted the jxom/request-errors branch April 7, 2023 04:23
@github-actions github-actions bot mentioned this pull request Apr 7, 2023
jxom added a commit that referenced this pull request Apr 7, 2023
* fix: make `GetValue` return `{ value?: never }` for contract functions that are not payable (#310)

fix: GetValue type

* Version Packages (#311)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* refactor: use `@adraffy/ens-normalize` for ENS normalization (#313)

* refactor: use @adraffy/ens-normalize for ENS normalization

* docs: update

* Version Packages (#315)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: `transports` property type on `FallbackTransport` (#317)

* Version Packages (#318)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: migrate to nodenext module resolution

* chore: fix type imports

* chore: use `bundler` module resolution for playgrounds so that path aliases are simpler

* fix: ethers adapter signTransaction properties (#322)

* fix: ethers adapter

* test: boost coverage

* Version Packages (#324)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: skip invalid logs (#326)

* fix: skip invalid logs

* chore: format

* chore: changeset

* Version Packages (#327)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: tweaked error inheritence for `UserRejectedRequestError` & `SwitchChainError` (#328)

* feat: tweaked error inheritence for `UserRejectedRequestError` & `SwitchChainError`

* chore: format

* chore: switch to tsc

* chore: apply rome formatting & linting changes

* chore: bump to typescript v5

* chore: remove tsup config

* chore: improve build step

* chore: add comment to version.ts

* chore: fix imports

* chore: add changeset

* chore: fix type imports

* chore: ignore tsbuildinfo

* fix: type issues

* chore: Contains -> Or

* chore: format

* chore: format

---------

Co-authored-by: jxom <jakemoxey@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: awkweb <tom@meagher.co>
jxom added a commit that referenced this pull request Apr 7, 2023
* fix: make `GetValue` return `{ value?: never }` for contract functions that are not payable (#310)

fix: GetValue type

* Version Packages (#311)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* refactor: use `@adraffy/ens-normalize` for ENS normalization (#313)

* refactor: use @adraffy/ens-normalize for ENS normalization

* docs: update

* Version Packages (#315)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: `transports` property type on `FallbackTransport` (#317)

* Version Packages (#318)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: migrate to nodenext module resolution

* chore: fix type imports

* chore: use `bundler` module resolution for playgrounds so that path aliases are simpler

* fix: ethers adapter signTransaction properties (#322)

* fix: ethers adapter

* test: boost coverage

* Version Packages (#324)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: skip invalid logs (#326)

* fix: skip invalid logs

* chore: format

* chore: changeset

* Version Packages (#327)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: tweaked error inheritence for `UserRejectedRequestError` & `SwitchChainError` (#328)

* feat: tweaked error inheritence for `UserRejectedRequestError` & `SwitchChainError`

* chore: format

* chore: switch to tsc

* chore: apply rome formatting & linting changes

* chore: bump to typescript v5

* chore: remove tsup config

* chore: improve build step

* chore: add comment to version.ts

* chore: fix imports

* chore: add changeset

* chore: fix type imports

* chore: ignore tsbuildinfo

* fix: type issues

* chore: Contains -> Or

* chore: format

* chore: format

---------

Co-authored-by: jxom <jakemoxey@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: awkweb <tom@meagher.co>
jxom added a commit that referenced this pull request Apr 7, 2023
* chore: switch to tsc

* chore: apply rome formatting & linting changes

* chore: bump to typescript v5

* chore: remove tsup config

* chore: improve build step

* chore: add comment to version.ts

* chore: fix imports

* chore: add changeset

* chore: revert uts46 import changes

* chore: fix type imports

* chore: ignore tsbuildinfo

* fix: type issues

* chore: Contains -> Or

* chore: format

* chore: switch to nodenext module resolution (#309)

* fix: make `GetValue` return `{ value?: never }` for contract functions that are not payable (#310)

fix: GetValue type

* Version Packages (#311)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* refactor: use `@adraffy/ens-normalize` for ENS normalization (#313)

* refactor: use @adraffy/ens-normalize for ENS normalization

* docs: update

* Version Packages (#315)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: `transports` property type on `FallbackTransport` (#317)

* Version Packages (#318)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: migrate to nodenext module resolution

* chore: fix type imports

* chore: use `bundler` module resolution for playgrounds so that path aliases are simpler

* fix: ethers adapter signTransaction properties (#322)

* fix: ethers adapter

* test: boost coverage

* Version Packages (#324)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* fix: skip invalid logs (#326)

* fix: skip invalid logs

* chore: format

* chore: changeset

* Version Packages (#327)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: tweaked error inheritence for `UserRejectedRequestError` & `SwitchChainError` (#328)

* feat: tweaked error inheritence for `UserRejectedRequestError` & `SwitchChainError`

* chore: format

* chore: switch to tsc

* chore: apply rome formatting & linting changes

* chore: bump to typescript v5

* chore: remove tsup config

* chore: improve build step

* chore: add comment to version.ts

* chore: fix imports

* chore: add changeset

* chore: fix type imports

* chore: ignore tsbuildinfo

* fix: type issues

* chore: Contains -> Or

* chore: format

* chore: format

---------

Co-authored-by: jxom <jakemoxey@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: awkweb <tom@meagher.co>

* Delete eleven-donkeys-lay.md

* Delete jsconfig.json

* Update cuddly-candles-begin.md

---------

Co-authored-by: Sebastian Lorenz <fubhy@fubhy.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: awkweb <tom@meagher.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant