@valve-tech/viem-errors 0.8.0 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,42 @@ this file.
6
6
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
7
7
  and this project adheres to [Semantic Versioning](https://semver.org/).
8
8
 
9
+ ## [0.9.3] — 2026-05-08
10
+
11
+ Synchronized release — no changes to this package. Republished at
12
+ 0.9.3 alongside the rest of the toolkit so all six packages share
13
+ one synced version line on npm. v0.9.2 had published this package
14
+ successfully but skipped `tx-flight-react` (workflow file was
15
+ missing a publish step); v0.9.3 fixes that and re-publishes
16
+ everything from one tag.
17
+
18
+ ## [0.9.2] — 2026-05-08
19
+
20
+ Synchronized release — no changes to this package. Companion fix
21
+ to v0.9.1: the root `build` script now uses `--topological-dev`
22
+ so workspace `devDependencies` (added to `tx-flight-react` in
23
+ v0.9.1) actually drive build ordering. First version of the v0.9.x
24
+ line on npm for this package, but the toolkit-wide v0.9.x line
25
+ didn't reach all six packages until v0.9.3.
26
+
27
+ ## [0.9.1] — 2026-05-08
28
+
29
+ *Not published — the Release workflow's Build step failed for the
30
+ same reason as v0.9.0. Superseded by v0.9.2.* Synchronized release;
31
+ no changes to this package itself.
32
+
33
+ ## [0.9.0] — 2026-05-08
34
+
35
+ Synchronized release — no changes to this package. Bumped in lockstep
36
+ with the rest of the toolkit, alongside the new
37
+ `@valve-tech/tx-flight-react` package. *Not published — the Release
38
+ workflow's build step failed before publish; superseded by v0.9.1.*
39
+
40
+ ## [0.8.1] — 2026-05-07
41
+
42
+ ### Removed
43
+ - Defensive `link === null || link === undefined` guard in `isUserRejectionError`. `walkErrorCause`'s generator returns when the current link is nullish (`walk.ts:34`), so it never yields null/undefined — the guard was unreachable. No effect on public behavior; 100/100/100/100 coverage holds.
44
+
9
45
  ## [0.8.0] — 2026-05-06
10
46
 
11
47
  Synced version bump; no functional changes.
@@ -1 +1 @@
1
- {"version":3,"file":"rejection.d.ts","sourceRoot":"","sources":["../src/rejection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,0EAA0E;AAC1E,eAAO,MAAM,sBAAsB,wCAAwC,CAAA;AAS3E;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAoB5D"}
1
+ {"version":3,"file":"rejection.d.ts","sourceRoot":"","sources":["../src/rejection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,0EAA0E;AAC1E,eAAO,MAAM,sBAAsB,wCAAwC,CAAA;AAS3E;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAgB5D"}
package/dist/rejection.js CHANGED
@@ -40,13 +40,8 @@ const REJECTION_MESSAGE_PATTERN = /user rejected|user denied|rejected the reques
40
40
  */
41
41
  export function isUserRejectionError(error) {
42
42
  for (const link of walkErrorCause(error)) {
43
- // walkErrorCause's contract is to never yield null/undefined
44
- // (it returns at depth 0 when current is nullish), so this
45
- // guard is defensive — kept in case a future change to the
46
- // generator relaxes that invariant.
47
- /* c8 ignore next */
48
- if (link === null || link === undefined)
49
- continue;
43
+ // walkErrorCause never yields null/undefined (it returns when
44
+ // the current link is nullish see walk.ts line 34).
50
45
  if (typeof link === 'string') {
51
46
  if (REJECTION_MESSAGE_PATTERN.test(link))
52
47
  return true;
@@ -1 +1 @@
1
- {"version":3,"file":"rejection.js","sourceRoot":"","sources":["../src/rejection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE1C,0EAA0E;AAC1E,MAAM,CAAC,MAAM,sBAAsB,GAAG,qCAAqC,CAAA;AAE3E;;;;GAIG;AACH,MAAM,yBAAyB,GAAG,+FAA+F,CAAA;AAEjI;;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Ac,CAAC,KAAK,CAAC,EAAE,CAAC;QACzC,8DAA8D;QAC9D,sDAAsD;QACtD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,IAAI,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,OAAO,IAAI,CAAA;YACrD,SAAQ;QACV,CAAC;QACD,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,SAAQ;QAEtC,MAAM,IAAI,GAAG,IAA6D,CAAA;QAC1E,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI;YAAE,OAAO,IAAI,CAAA;QACnC,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,0BAA0B;YAAE,OAAO,IAAI,CAAA;QAC1F,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,OAAO,IAAI,CAAA;IACnG,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valve-tech/viem-errors",
3
- "version": "0.8.0",
3
+ "version": "0.9.3",
4
4
  "description": "Cause-chain-aware error utilities for viem-based dapps. Detect EIP-1193 user rejections (4001 / class name / message regex), extract decoded custom Solidity error names from anywhere in viem's nested cause chain, map raw RPC/wallet/contract errors to short user-friendly messages with overridable patterns, and route wagmi-style onError sinks through one helper. Pure functions, no runtime dependencies. Part of the valve-tech/evm-toolkit synchronized release line.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/valve-tech/evm-toolkit/tree/main/packages/viem-errors#readme",