@valve-tech/viem-errors 0.8.0 → 0.9.2

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,32 @@ 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.2] — 2026-05-08
10
+
11
+ Synchronized release — no changes to this package. Companion fix
12
+ to v0.9.1: the root `build` script now uses `--topological-dev`
13
+ so workspace `devDependencies` (added to `tx-flight-react` in
14
+ v0.9.1) actually drive build ordering. v0.9.2 is the first version
15
+ of the v0.9.x line to land on npm for this package.
16
+
17
+ ## [0.9.1] — 2026-05-08
18
+
19
+ *Not published — the Release workflow's Build step failed for the
20
+ same reason as v0.9.0. Superseded by v0.9.2.* Synchronized release;
21
+ no changes to this package itself.
22
+
23
+ ## [0.9.0] — 2026-05-08
24
+
25
+ Synchronized release — no changes to this package. Bumped in lockstep
26
+ with the rest of the toolkit, alongside the new
27
+ `@valve-tech/tx-flight-react` package. *Not published — the Release
28
+ workflow's build step failed before publish; superseded by v0.9.1.*
29
+
30
+ ## [0.8.1] — 2026-05-07
31
+
32
+ ### Removed
33
+ - 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.
34
+
9
35
  ## [0.8.0] — 2026-05-06
10
36
 
11
37
  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;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,KAAK,MAAM,IAAI,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QACzC,6DAA6D;QAC7D,2DAA2D;QAC3D,2DAA2D;QAC3D,oCAAoC;QACpC,oBAAoB;QACpB,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KA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AAQ;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.2",
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",