feat(sdk-coin-vet): address and wallet creation #6218
Merged
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.
Ticket: COIN-4185
This pull request introduces several enhancements and new features to the
sdk-coin-vetmodule, including dependency updates, implementation of previously unimplemented methods, and additional test cases to ensure functionality. These changes improve the module's utility and robustness.Dependency Updates:
@bitgo/abstract-eth,@bitgo/secp256k1, andcryptoto support cryptographic operations and Ethereum-related functionality. (modules/sdk-coin-vet/package.json, modules/sdk-coin-vet/package.jsonL44-R46)Feature Implementations:
isValidAddressmethod inUtilsto validate Ethereum-style addresses using a regular expression. (modules/sdk-coin-vet/src/lib/utils.ts, modules/sdk-coin-vet/src/lib/utils.tsL5-R5)Vetclass to:isWalletAddressmethod, throwing anInvalidAddressErrorfor invalid addresses. (modules/sdk-coin-vet/src/vet.ts, modules/sdk-coin-vet/src/vet.tsL81-R90)generateKeyPairmethod to create extended key pairs usingbip32andrandomBytes. (modules/sdk-coin-vet/src/vet.ts, modules/sdk-coin-vet/src/vet.tsL97-R127)isValidPubmethod to validate public keys usingEthKeyPair. (modules/sdk-coin-vet/src/vet.ts, modules/sdk-coin-vet/src/vet.tsL97-R127)Test Enhancements:
isValidAddressmethod to verify its correctness with various valid and invalid Ethereum-style addresses. (modules/sdk-coin-vet/test/unit/vet.ts, modules/sdk-coin-vet/test/unit/vet.tsR28-R36)