@deserialize/multi-vm-wallet 1.5.0 → 1.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/evm/evm.js CHANGED
@@ -21,7 +21,6 @@ class EVMVM extends vm_1.VM {
21
21
  static getTokenInfo = utils_1.getTokenInfo;
22
22
  generatePrivateKey(index, seed, mnemonic, derivationPath = this.derivationPath) {
23
23
  vm_validation_1.VMValidation.validateIndex(index, 'Wallet index');
24
- vm_validation_1.VMValidation.validateDerivationPath(derivationPath + index + "'", 'EVM');
25
24
  let _seed;
26
25
  if (seed) {
27
26
  vm_validation_1.VMValidation.validateSeed(seed);
package/dist/svm/svm.js CHANGED
@@ -49,7 +49,6 @@ class SVMVM extends vm_1.VM {
49
49
  };
50
50
  generatePrivateKey(index, seed, mnemonic, derivationPath = this.derivationPath) {
51
51
  vm_validation_1.VMValidation.validateIndex(index, 'Wallet index');
52
- vm_validation_1.VMValidation.validateDerivationPath(derivationPath + index + "'", 'SVM');
53
52
  let _seed;
54
53
  if (seed) {
55
54
  vm_validation_1.VMValidation.validateSeed(seed);
@@ -3,7 +3,6 @@ export declare class VMValidation {
3
3
  static validateSeed(seed: string): void;
4
4
  static validateMnemonic(mnemonic: string): void;
5
5
  static validateDerivationPath(path: string, vmType?: 'EVM' | 'SVM'): void;
6
- static validatePassword(password: string, minLength?: number): void;
7
6
  static validateAmount(amount: bigint, label?: string): void;
8
7
  static validateEthereumAddress(address: string, label?: string): void;
9
8
  }
@@ -87,18 +87,6 @@ class VMValidation {
87
87
  }
88
88
  }
89
89
  }
90
- static validatePassword(password, minLength = 8) {
91
- if (typeof password !== 'string') {
92
- throw new Error(`Password must be a string, got: ${typeof password}`);
93
- }
94
- if (password.length < minLength) {
95
- throw new Error(`Password too short. Minimum length: ${minLength}, got: ${password.length}`);
96
- }
97
- const weakPasswords = ['password', '12345678', 'qwerty', 'abc123'];
98
- if (weakPasswords.includes(password.toLowerCase())) {
99
- throw new Error('Password is too weak. Choose a stronger password.');
100
- }
101
- }
102
90
  static validateAmount(amount, label = 'Amount') {
103
91
  if (typeof amount !== 'bigint') {
104
92
  throw new Error(`${label} must be a bigint, got: ${typeof amount}`);
@@ -87,7 +87,6 @@ function GenerateSeed(_mnemonic) {
87
87
  function EVMDeriveChildPrivateKey(seed, index, derivationPath) {
88
88
  vm_validation_1.VMValidation.validateSeed(seed);
89
89
  vm_validation_1.VMValidation.validateIndex(index, 'Wallet index');
90
- vm_validation_1.VMValidation.validateDerivationPath(derivationPath + index + "'", 'EVM');
91
90
  const path = `${derivationPath}${index}'`;
92
91
  const scureNode = bip32_1.HDKey.fromMasterSeed(buffer_1.Buffer.from(seed, "hex"));
93
92
  const child = scureNode.derive(path);
@@ -101,7 +100,6 @@ function EVMDeriveChildPrivateKey(seed, index, derivationPath) {
101
100
  function SVMDeriveChildPrivateKey(seed, index, derivationPath) {
102
101
  vm_validation_1.VMValidation.validateSeed(seed);
103
102
  vm_validation_1.VMValidation.validateIndex(index, 'Wallet index');
104
- vm_validation_1.VMValidation.validateDerivationPath(derivationPath + index + "'", 'SVM');
105
103
  const path = `${derivationPath}${index}'`;
106
104
  const derivedSeed = derivePathEclipticCurve(path, buffer_1.Buffer.from(seed, "hex")).key;
107
105
  const derivedKeyPair = web3_js_1.Keypair.fromSeed(derivedSeed);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deserialize/multi-vm-wallet",
3
- "version": "1.5.0",
3
+ "version": "1.5.11",
4
4
  "devDependencies": {
5
5
  "@types/bn.js": "^5.2.0",
6
6
  "@types/crypto-js": "^4.2.2",
package/utils/evm/evm.ts CHANGED
@@ -101,7 +101,7 @@ export class EVMVM extends VM<string, string, PublicClient> {
101
101
  generatePrivateKey(index: number, seed?: string, mnemonic?: string, derivationPath = this.derivationPath) {
102
102
  // Validate inputs
103
103
  VMValidation.validateIndex(index, 'Wallet index');
104
- VMValidation.validateDerivationPath(derivationPath + index + "'", 'EVM');
104
+ // VMValidation.validateDerivationPath(derivationPath + index + "'", 'EVM');
105
105
 
106
106
  let _seed: string;
107
107
 
@@ -253,8 +253,8 @@ export class EVMVM extends VM<string, string, PublicClient> {
253
253
  checkInParallel,
254
254
  batchSize: options?.batchSize ?? 10, // Larger batch for better performance
255
255
  checkDelay: options?.checkDelay ?? (checkInParallel ? 200 : 50),
256
- onProgress: options?.onProgress ?? (() => {}),
257
- onDiscovered: options?.onDiscovered ?? (() => {}),
256
+ onProgress: options?.onProgress ?? (() => { }),
257
+ onDiscovered: options?.onDiscovered ?? (() => { }),
258
258
  };
259
259
 
260
260
  const discovered: DiscoveredWallet[] = [];
@@ -492,8 +492,8 @@ export class EVMVM extends VM<string, string, PublicClient> {
492
492
  checkInParallel,
493
493
  batchSize: options?.batchSize ?? 10,
494
494
  checkDelay: options?.checkDelay ?? (checkInParallel ? 200 : 50),
495
- onProgress: options?.onProgress ?? (() => {}),
496
- onDiscovered: options?.onDiscovered ?? (() => {}),
495
+ onProgress: options?.onProgress ?? (() => { }),
496
+ onDiscovered: options?.onDiscovered ?? (() => { }),
497
497
  walletIndex,
498
498
  };
499
499
 
package/utils/svm/svm.ts CHANGED
@@ -73,7 +73,7 @@ export class SVMVM extends VM<PublicKey, Keypair, Connection> {
73
73
  generatePrivateKey(index: number, seed?: string, mnemonic?: string, derivationPath = this.derivationPath) {
74
74
  // Validate inputs
75
75
  VMValidation.validateIndex(index, 'Wallet index');
76
- VMValidation.validateDerivationPath(derivationPath + index + "'", 'SVM');
76
+ // VMValidation.validateDerivationPath(derivationPath + index + "'", 'SVM');
77
77
 
78
78
  let _seed: string;
79
79
 
@@ -161,23 +161,23 @@ export class VMValidation {
161
161
  * @param minLength - Minimum password length (default: 8)
162
162
  * @throws Error if password is weak
163
163
  */
164
- static validatePassword(password: string, minLength: number = 8): void {
165
- if (typeof password !== 'string') {
166
- throw new Error(`Password must be a string, got: ${typeof password}`);
167
- }
168
-
169
- if (password.length < minLength) {
170
- throw new Error(
171
- `Password too short. Minimum length: ${minLength}, got: ${password.length}`
172
- );
173
- }
174
-
175
- // Check for common weak passwords
176
- const weakPasswords = ['password', '12345678', 'qwerty', 'abc123'];
177
- if (weakPasswords.includes(password.toLowerCase())) {
178
- throw new Error('Password is too weak. Choose a stronger password.');
179
- }
180
- }
164
+ // static validatePassword(password: string, minLength: number = 8): void {
165
+ // if (typeof password !== 'string') {
166
+ // throw new Error(`Password must be a string, got: ${typeof password}`);
167
+ // }
168
+
169
+ // if (password.length < minLength) {
170
+ // throw new Error(
171
+ // `Password too short. Minimum length: ${minLength}, got: ${password.length}`
172
+ // );
173
+ // }
174
+
175
+ // // Check for common weak passwords
176
+ // const weakPasswords = ['password', '12345678', 'qwerty', 'abc123'];
177
+ // if (weakPasswords.includes(password.toLowerCase())) {
178
+ // throw new Error('Password is too weak. Choose a stronger password.');
179
+ // }
180
+ // }
181
181
 
182
182
  /**
183
183
  * Validate amount (bigint)
@@ -135,7 +135,7 @@ export function EVMDeriveChildPrivateKey(seed: string, index: number, derivation
135
135
  // Validate inputs
136
136
  VMValidation.validateSeed(seed);
137
137
  VMValidation.validateIndex(index, 'Wallet index');
138
- VMValidation.validateDerivationPath(derivationPath + index + "'", 'EVM');
138
+ // VMValidation.validateDerivationPath(derivationPath + index + "'", 'EVM');
139
139
 
140
140
  const path = `${derivationPath}${index}'`;
141
141
  const scureNode = HDKey.fromMasterSeed(Buffer.from(seed, "hex"));
@@ -164,7 +164,7 @@ export function SVMDeriveChildPrivateKey(seed: string, index: number, derivation
164
164
  // Validate inputs
165
165
  VMValidation.validateSeed(seed);
166
166
  VMValidation.validateIndex(index, 'Wallet index');
167
- VMValidation.validateDerivationPath(derivationPath + index + "'", 'SVM');
167
+ // VMValidation.validateDerivationPath(derivationPath + index + "'", 'SVM');
168
168
 
169
169
  const path = `${derivationPath}${index}'`;
170
170