-
Notifications
You must be signed in to change notification settings - Fork 0
[KLC-2101] Fix encoding of arrayN<T> types in ABI encoder #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[KLC-2101] Fix encoding of arrayN<T> types in ABI encoder #5
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.
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 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
|
|
FYI: the new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
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