wallaby-cash 3.9.0 → 3.10.0
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/helpers/validation.d.ts +18 -0
- package/dist/index.cjs.js +8 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +9 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/package.json +6 -12
- package/dist/types/error-response-codes.d.ts +34 -3
- package/package.json +6 -12
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { WallabyConfig } from '../types';
|
|
2
2
|
export declare function isValidInput(input: string): boolean;
|
|
3
3
|
export declare function isValidJwt(token: string): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* BIP-39 only recognises the canonical form: NFKD-normalized, lowercase, single-space separated.
|
|
6
|
+
* Pasted phrases routinely carry newlines, double spaces or capitalization, none of which the
|
|
7
|
+
* enclave accepts, so normalize before validating and before sending. A phrase that only differs
|
|
8
|
+
* in those characters derives the same wallet, so this rescues the input rather than rejecting it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalizeSeedPhrase(seedPhrase: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* True when the phrase is a valid BIP-39 mnemonic (checksum included) once normalized.
|
|
13
|
+
* Exposed so a UI can validate the field before submitting instead of catching a thrown error.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isValidSeedPhrase(seedPhrase: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the normalized phrase, or throws the same 400 the enclave would return for it.
|
|
18
|
+
* Validating here keeps an invalid seed phrase off the wire and gives the caller an error that
|
|
19
|
+
* names the problem, instead of an opaque `Bad Request` from the far side of the API.
|
|
20
|
+
*/
|
|
21
|
+
export declare function assertValidSeedPhrase(seedPhrase: string, message?: string): string;
|
|
4
22
|
export declare function sanitizeConfig(config: WallabyConfig): WallabyConfig;
|