Skip to Content
API Reference@parity/product-sdk-errorsOverview

@parity/product-sdk-errors

the cross-package SdkError marker for the @parity/product-sdk family.

This is intentionally separate from the generic @parity/result package: @parity/result is a domain-agnostic Result primitive (safe to embed anywhere, including upstream in @parity/truapi), whereas the SdkError marker below is specific to the @parity/product-sdk error taxonomy.

npm install @parity/product-sdk-errors

Exports

Functions

NameSummary
isSdkError()Check whether a value is any SdkError — i.e. any error raised by an

Interfaces

NameSummary
SdkErrorStructural marker implemented by every @parity/product-sdk-* base error.

Functions

isSdkError()

Check whether a value is any SdkError — i.e. any error raised by an @parity/product-sdk-* package.

Answers the cross-cutting “did the SDK raise this?” question in one call, without importing per-package error classes. For a specific class, use isErrorOf(e, SomeError) from @parity/result instead.

isSdkError(error: unknown): error is SdkError

Interfaces

interface SdkError

Structural marker implemented by every @parity/product-sdk-* base error.

Intentionally an interface, not a class: a package implements it by declaring isSdkError and source on its existing base error, which needs no runtime dependency on this package (only the type) — so it works even across the signer → host dependency edge.

Extends: Error

Properties

isSdkError
propertyreadonlytrue

Discriminant present on all SDK errors.

source
propertyreadonlystring

The package that raised the error, e.g. "host", "signer", "contracts".