Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

Add TypeScript types for wif.js ✅

  • Create wif.d.ts with type definitions for all exported functions
  • Add wif.d.ts to package.json files list
  • Add types export to package.json exports for ./wif.js
  • Run linter to validate changes (pre-existing linter warnings unrelated to this change)
  • Run tests to ensure types work correctly (all 4 tests pass)
  • Code review completed (1 false positive about async functions)
  • Security scan completed (no issues found)
  • Remove package-lock.json (shouldn't be included as project uses pnpm)
  • Add detailed documentation for WIF functions to README.md
  • Fix parameter name consistency to match implementation
  • Match import syntax exactly with README

Summary

Successfully added TypeScript type definitions for the wif.js module, following the same pattern as other modules in the repository (e.g., base64.d.ts, hex.d.ts, base32.d.ts).

Updated README.md with comprehensive documentation for all WIF functions including descriptions, parameters, return values, and error conditions. Parameter names now match the actual implementation.

Import syntax in the type definitions now matches the README exactly (split into two import statements).

Security Summary: No vulnerabilities discovered.

Original prompt

This section details on the original issue you should resolve

<issue_title>Types: wif.js</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix types in wif.js Add TypeScript types for wif.js Jan 22, 2026
Copilot AI requested a review from ChALkeR January 22, 2026 10:47
@ChALkeR ChALkeR changed the title Add TypeScript types for wif.js feat: add TypeScript types for wif.js Jan 22, 2026
Copy link
Collaborator

@ChALkeR ChALkeR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot

  1. remove package-lock.json (without gitignoring it)
  2. mirror the doc to README

Copy link
Contributor

@kewdex kewdex Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot remove this file, we use pnpm

Copy link
Contributor Author

Copilot AI commented Jan 22, 2026

@copilot

  1. remove package-lock.json (without gitignoring it)
  2. mirror the doc to README

Done in commits e3852ec and 46052ee:

  1. Removed package-lock.json
  2. Added detailed WIF documentation to README mirroring the type definitions, including function descriptions, parameter details, return values, and error conditions

Copilot AI requested a review from ChALkeR January 22, 2026 13:05
Copy link
Contributor

@kewdex kewdex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

LGTM

@ChALkeR ChALkeR force-pushed the copilot/fix-types-wif-js branch from e3852ec to 46d9702 Compare January 22, 2026 16:02
Copilot AI and others added 4 commits January 22, 2026 20:03
Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com>
Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com>
…sion'

Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com>
@ChALkeR ChALkeR force-pushed the copilot/fix-types-wif-js branch from 46d9702 to c0aeff7 Compare January 22, 2026 16:03
wif.d.ts Outdated
* Also no inconsistent behavior on Buffer/Uint8Array input.
*
* ```js
* import { fromWifString, toWifString, fromWifStringSync, toWifStringSync } from '@exodus/bytes/wif.js'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Use the exact import syntax from README

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 52b3552. The import syntax now matches the README exactly with two separate import statements.

Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com>
Copilot AI requested a review from ChALkeR January 22, 2026 16:07
@ChALkeR ChALkeR marked this pull request as ready for review January 22, 2026 18:00
@ChALkeR ChALkeR requested a review from Copilot January 22, 2026 18:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds TypeScript type definitions for the wif.js module, following the established patterns used by other modules in the repository (such as base58check.d.ts, base64.d.ts, etc.).

Changes:

  • Created comprehensive TypeScript type definitions in wif.d.ts with JSDoc documentation for all exported functions
  • Updated package.json to include wif.d.ts in the files list and added types export configuration
  • Enhanced README.md with detailed function documentation including descriptions, parameters, return values, and error conditions

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
wif.d.ts Adds TypeScript type definitions for the Wif interface and all exported functions (fromWifString, fromWifStringSync, toWifString, toWifStringSync) with comprehensive JSDoc documentation
package.json Adds wif.d.ts to the files list and configures the types export for ./wif.js module
README.md Enhances documentation for WIF functions with detailed descriptions, parameter documentation, and behavior specifications

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ChALkeR ChALkeR merged commit 4f4aad1 into main Jan 22, 2026
36 checks passed
@ChALkeR ChALkeR deleted the copilot/fix-types-wif-js branch January 22, 2026 20:32
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.

Types: wif.js

3 participants