@valve-tech/viem-errors 0.5.0 → 0.7.0

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,28 @@ 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.7.0] — 2026-05-06
10
+
11
+ ### Notes
12
+
13
+ - Synchronized release — no consumer-visible behavior changes.
14
+ Bumped in lockstep with `@valve-tech/tx-tracker@0.7.0` (the
15
+ first real implementation release of the per-tx state machine).
16
+ Internal-only: a `/* c8 ignore */` annotation was added inside
17
+ `isUserRejectionError` for an unreachable defensive guard
18
+ (`walkErrorCause`'s contract is to never yield nullish links);
19
+ doesn't change behavior.
20
+
21
+ ## [0.6.0] — 2026-05-05
22
+
23
+ ### Notes
24
+
25
+ - Synchronized release — no changes to this package. Bumped in
26
+ lockstep with `@valve-tech/chain-source@0.6.0` (block-stream
27
+ dedup + head-probe gating in the source tick) and
28
+ `@valve-tech/gas-oracle@0.6.0` (now consumes ChainSource via
29
+ `source?: ChainSource`).
30
+
9
31
  ## [0.5.0] — 2026-05-05
10
32
 
11
33
  ### Notes
@@ -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,CAe5D"}
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"}
package/dist/rejection.js CHANGED
@@ -40,6 +40,11 @@ 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 */
43
48
  if (link === null || link === undefined)
44
49
  continue;
45
50
  if (typeof link === 'string') {
@@ -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,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS;YAAE,SAAQ;QACjD,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,QA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I,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.5.0",
3
+ "version": "0.7.0",
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",