@deserialize/multi-vm-wallet 1.5.1 → 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/vm-validation.d.ts +0 -1
- package/dist/vm-validation.js +0 -12
- package/package.json +1 -1
- package/utils/vm-validation.ts +17 -17
package/dist/vm-validation.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/vm-validation.js
CHANGED
|
@@ -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}`);
|
package/package.json
CHANGED
package/utils/vm-validation.ts
CHANGED
|
@@ -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
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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)
|