Skip to content

docs: add comprehensive JSDoc documentation to utility functions and error classes - #1838

Open
Dark-Brain07 wants to merge 2 commits into
stx-labs:mainfrom
Dark-Brain07:improve/docs-and-tests
Open

docs: add comprehensive JSDoc documentation to utility functions and error classes#1838
Dark-Brain07 wants to merge 2 commits into
stx-labs:mainfrom
Dark-Brain07:improve/docs-and-tests

Conversation

@Dark-Brain07

Copy link
Copy Markdown

Description

This PR adds comprehensive JSDoc documentation to exported utility functions in utils.ts and all error classes in errors.ts within the @stacks/transactions package.

Changes

packages/transactions/src/utils.ts

  • Added JSDoc with @param, @returns, and @example tags to:
    • leftPadHex
    • leftPadHexToLength
    • rightPadHexToLength
    • exceedsMaxLengthBytes
    • hash160
    • isClarityName
    • validateStacksAddress

packages/transactions/src/errors.ts

  • Added JSDoc documentation with usage examples to all error classes:
    • TransactionError (base class)
    • SerializationError
    • DeserializationError
    • NoEstimateAvailableError
    • NotImplementedError
    • SigningError
    • VerificationError

Motivation

These utility functions and error classes are widely used across the Stacks ecosystem but lacked inline documentation. Adding JSDoc improves:

  • IDE experience — developers get instant hover documentation and parameter hints
  • Onboarding — new contributors can understand function behavior without reading source code
  • API reference generation — JSDoc tags enable automated documentation tools

Testing

Documentation-only changes. No functional code was modified.

@Dark-Brain07
Dark-Brain07 force-pushed the improve/docs-and-tests branch from 190339e to 6e73b59 Compare February 14, 2026 05:40
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.

2 participants