[KLC-2101] Fix encoding of arrayN<T> types in ABI encoder#5
Merged
fbsobreira merged 7 commits intomasterfrom Feb 2, 2026
Merged
Conversation
Dependency ReviewThe following issues were found:
License Issuespnpm-lock.yaml
OpenSSF Scorecard
Scanned Files
|
📦 Bundle Size Report
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the ABI encoder's handling of fixed-size arrays and adds comprehensive HD wallet and keystore functionality to the SDK.
Changes:
- Fixes encoding of
arrayN<u8>types to accept hex strings andUint8Arrayinputs, particularly important for encoding hash values (e.g.,array32<u8>) - Adds BIP39/BIP44 HD wallet support with mnemonic generation and key derivation using SLIP-10 Ed25519
- Adds Web3 Secret Storage (keystore) encryption/decryption with AES-256-GCM and scrypt KDF
- Extends WalletFactory with methods to create wallets from mnemonics, keystores, and random generation
- Adds encrypt() methods to NodeWallet and BrowserWallet for keystore creation
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/connect-contracts/src/encoder/abi-encoder.ts | Adds hex string and Uint8Array input support for arrayN types with validation |
| packages/connect-contracts/src/tests/encoder.test.ts | Comprehensive test coverage for fixed-size array encoding with various input formats |
| packages/connect-crypto/src/slip10-ed25519.ts | New SLIP-10 Ed25519 key derivation implementation for BIP44 paths |
| packages/connect-crypto/src/hd-wallet.ts | New HD wallet functions for mnemonic generation, validation, and key derivation |
| packages/connect-crypto/src/keystore.ts | New Web3 Secret Storage keystore encryption/decryption with AES-256-GCM |
| packages/connect-crypto/src/tests/keystore.test.ts | Comprehensive keystore encryption/decryption tests |
| packages/connect-crypto/src/tests/hd-wallet.test.ts | Comprehensive HD wallet tests covering all mnemonic and derivation functions |
| packages/connect-crypto/src/tests/index.test.ts | Integration tests for new crypto exports |
| packages/connect-crypto/src/index.ts | Exports for new HD wallet and keystore functionality |
| packages/connect-crypto/package.json | Adds @scure/bip32 dependency for BIP32 derivation |
| packages/connect-wallet/src/wallet-factory.ts | Adds createRandom(), fromMnemonic(), fromEncryptedJson(), and mnemonicToPrivateKey() methods |
| packages/connect-wallet/src/types/wallet.ts | Adds optional encrypt() method to Wallet interface |
| packages/connect-wallet/src/node/index.ts | Adds encrypt() method and protected getPrivateKey() |
| packages/connect-wallet/src/browser/index.ts | Adds encrypt() method with extension mode check |
| packages/connect-wallet/src/index.ts | Minor comment removal |
| tsconfig.base.json | Adds "DOM" lib for crypto.subtle API support |
| pnpm-lock.yaml | Dependency updates including glob, js-yaml, and @scure/bip32 |
| package.json | Adds overrides for glob and js-yaml |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📦 Bundle Size Report
|
📦 Bundle Size Report
|
Member
Author
|
FYI: the new |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📦 Bundle Size Report
|
fbsobreira
approved these changes
Jan 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix encoding of
arrayN<T>types in the ABI encoder to properly handle hex strings andUint8Arrayinputs foru8arrays. This is particularly important for encoding hash values (e.g.,array32<u8>) which are commonly passed as hex strings.Type of Change
Related Issues
Closes #KLC-2101
Changes Made
arrayN<u8>types (with and without0xprefix)Uint8Arrayinput support forarrayN<u8>typesTesting
Test Coverage
Test Instructions