Skip to content

Conversation

@OttoAllmendinger
Copy link
Contributor

This PR implements several enhancements to the WASM-UTXO module:

  1. Introduces a namespace wrapper pattern for better TypeScript APIs,
    replacing loose types with precise TypeScript definitions for improved
    IDE autocompletion and compile-time safety

  2. Adds BIP32Interface support for wallet keys, allowing more flexibility
    when working with existing BIP32 key objects

  3. Reorganizes test structure by moving fixed script wallet tests to a
    dedicated file for better organization

  4. Adds wasm-bindgen-test dependencies to support browser-based WASM
    testing

These changes improve the developer experience, code organization, and
testing capabilities of the WASM-UTXO module.

BTC-2652

OttoAllmendinger and others added 2 commits October 28, 2025 14:11
Add testing dependencies for writing browser-based WASM tests

Issue: BTC-2652

Co-authored-by: llm-git <[email protected]>
Move the wallet key address derivation tests from utxolibCompat.ts to a
new fixedScript/address.ts file for better organization and separation
of concerns.

Co-authored-by: llm-git <[email protected]>
@OttoAllmendinger OttoAllmendinger force-pushed the BTC-2652.improve-namespacing branch from e1ae569 to 6e96a78 Compare October 28, 2025 13:45
Add ability to parse and use wallet keys from BIP32Interface objects
instead of requiring xpub strings. This provides a more flexible API
for consuming code that already has BIP32 key objects. The implementation
supports both property access and toBase58() method to extract the keys.

Issue: BTC-2652

Co-authored-by: llm-git <[email protected]>
@OttoAllmendinger OttoAllmendinger force-pushed the BTC-2652.improve-namespacing branch from 6e96a78 to 67eca44 Compare October 28, 2025 13:53
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review October 28, 2025 13:58
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner October 28, 2025 13:58
…cript APIs

This PR introduces a cleaner, more type-safe architecture for WASM bindings:

1. Organizes related Rust functions into namespace classes
2. Wraps generated WASM bindings with precise TypeScript types
3. Creates dedicated wrapper modules for each feature area
4. Adds comprehensive documentation for the pattern

The pattern replaces loose types (`any`, `string | null`) with precise
TypeScript types, improving IDE autocompletion and compile-time safety.

Issue: BTC-2652

Co-authored-by: llm-git <[email protected]>
@OttoAllmendinger OttoAllmendinger force-pushed the BTC-2652.improve-namespacing branch from ec02178 to 8ecd880 Compare October 28, 2025 14:32
@OttoAllmendinger OttoAllmendinger merged commit f1c03fd into master Oct 28, 2025
1 check passed
@OttoAllmendinger OttoAllmendinger deleted the BTC-2652.improve-namespacing branch October 28, 2025 20:11
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.

3 participants