@xyo-network/bip39 2.75.0 → 2.75.2
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/browser/index.d.cts +65 -0
- package/dist/browser/index.d.cts.map +1 -0
- package/dist/browser/index.js +19 -18485
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/wordlists/czech.d.cts +2 -0
- package/dist/browser/wordlists/czech.d.cts.map +1 -0
- package/dist/browser/wordlists/czech.js +1 -2
- package/dist/browser/wordlists/czech.js.map +1 -1
- package/dist/browser/wordlists/english.d.cts +2 -0
- package/dist/browser/wordlists/english.d.cts.map +1 -0
- package/dist/browser/wordlists/english.js +1 -2
- package/dist/browser/wordlists/english.js.map +1 -1
- package/dist/browser/wordlists/french.d.cts +2 -0
- package/dist/browser/wordlists/french.d.cts.map +1 -0
- package/dist/browser/wordlists/french.js +1 -2
- package/dist/browser/wordlists/french.js.map +1 -1
- package/dist/browser/wordlists/index.d.cts +12 -0
- package/dist/browser/wordlists/index.d.cts.map +1 -0
- package/dist/browser/wordlists/index.js +19 -18461
- package/dist/browser/wordlists/index.js.map +1 -1
- package/dist/browser/wordlists/italian.d.cts +2 -0
- package/dist/browser/wordlists/italian.d.cts.map +1 -0
- package/dist/browser/wordlists/italian.js +1 -2
- package/dist/browser/wordlists/italian.js.map +1 -1
- package/dist/browser/wordlists/japanese.d.cts +2 -0
- package/dist/browser/wordlists/japanese.d.cts.map +1 -0
- package/dist/browser/wordlists/japanese.js +1 -2
- package/dist/browser/wordlists/japanese.js.map +1 -1
- package/dist/browser/wordlists/korean.d.cts +2 -0
- package/dist/browser/wordlists/korean.d.cts.map +1 -0
- package/dist/browser/wordlists/korean.js +1 -2
- package/dist/browser/wordlists/korean.js.map +1 -1
- package/dist/browser/wordlists/simplified-chinese.d.cts +2 -0
- package/dist/browser/wordlists/simplified-chinese.d.cts.map +1 -0
- package/dist/browser/wordlists/simplified-chinese.js +1 -2
- package/dist/browser/wordlists/simplified-chinese.js.map +1 -1
- package/dist/browser/wordlists/spanish.d.cts +2 -0
- package/dist/browser/wordlists/spanish.d.cts.map +1 -0
- package/dist/browser/wordlists/spanish.js +1 -2
- package/dist/browser/wordlists/spanish.js.map +1 -1
- package/dist/browser/wordlists/traditional-chinese.d.cts +2 -0
- package/dist/browser/wordlists/traditional-chinese.d.cts.map +1 -0
- package/dist/browser/wordlists/traditional-chinese.js +1 -2
- package/dist/browser/wordlists/traditional-chinese.js.map +1 -1
- package/dist/docs.json +1057 -0
- package/dist/node/index.d.cts +65 -0
- package/dist/node/index.d.cts.map +1 -0
- package/dist/node/index.js +18487 -21
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +18485 -19
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/wordlists/czech.d.cts +2 -0
- package/dist/node/wordlists/czech.d.cts.map +1 -0
- package/dist/node/wordlists/czech.js +3 -1
- package/dist/node/wordlists/czech.js.map +1 -1
- package/dist/node/wordlists/czech.mjs +2 -1
- package/dist/node/wordlists/czech.mjs.map +1 -1
- package/dist/node/wordlists/english.d.cts +2 -0
- package/dist/node/wordlists/english.d.cts.map +1 -0
- package/dist/node/wordlists/english.js +3 -1
- package/dist/node/wordlists/english.js.map +1 -1
- package/dist/node/wordlists/english.mjs +2 -1
- package/dist/node/wordlists/english.mjs.map +1 -1
- package/dist/node/wordlists/french.d.cts +2 -0
- package/dist/node/wordlists/french.d.cts.map +1 -0
- package/dist/node/wordlists/french.js +3 -1
- package/dist/node/wordlists/french.js.map +1 -1
- package/dist/node/wordlists/french.mjs +2 -1
- package/dist/node/wordlists/french.mjs.map +1 -1
- package/dist/node/wordlists/index.d.cts +12 -0
- package/dist/node/wordlists/index.d.cts.map +1 -0
- package/dist/node/wordlists/index.js +18464 -19
- package/dist/node/wordlists/index.js.map +1 -1
- package/dist/node/wordlists/index.mjs +18461 -19
- package/dist/node/wordlists/index.mjs.map +1 -1
- package/dist/node/wordlists/italian.d.cts +2 -0
- package/dist/node/wordlists/italian.d.cts.map +1 -0
- package/dist/node/wordlists/italian.js +3 -1
- package/dist/node/wordlists/italian.js.map +1 -1
- package/dist/node/wordlists/italian.mjs +2 -1
- package/dist/node/wordlists/italian.mjs.map +1 -1
- package/dist/node/wordlists/japanese.d.cts +2 -0
- package/dist/node/wordlists/japanese.d.cts.map +1 -0
- package/dist/node/wordlists/japanese.js +3 -1
- package/dist/node/wordlists/japanese.js.map +1 -1
- package/dist/node/wordlists/japanese.mjs +2 -1
- package/dist/node/wordlists/japanese.mjs.map +1 -1
- package/dist/node/wordlists/korean.d.cts +2 -0
- package/dist/node/wordlists/korean.d.cts.map +1 -0
- package/dist/node/wordlists/korean.js +3 -1
- package/dist/node/wordlists/korean.js.map +1 -1
- package/dist/node/wordlists/korean.mjs +2 -1
- package/dist/node/wordlists/korean.mjs.map +1 -1
- package/dist/node/wordlists/simplified-chinese.d.cts +2 -0
- package/dist/node/wordlists/simplified-chinese.d.cts.map +1 -0
- package/dist/node/wordlists/simplified-chinese.js +3 -1
- package/dist/node/wordlists/simplified-chinese.js.map +1 -1
- package/dist/node/wordlists/simplified-chinese.mjs +2 -1
- package/dist/node/wordlists/simplified-chinese.mjs.map +1 -1
- package/dist/node/wordlists/spanish.d.cts +2 -0
- package/dist/node/wordlists/spanish.d.cts.map +1 -0
- package/dist/node/wordlists/spanish.js +3 -1
- package/dist/node/wordlists/spanish.js.map +1 -1
- package/dist/node/wordlists/spanish.mjs +2 -1
- package/dist/node/wordlists/spanish.mjs.map +1 -1
- package/dist/node/wordlists/traditional-chinese.d.cts +2 -0
- package/dist/node/wordlists/traditional-chinese.d.cts.map +1 -0
- package/dist/node/wordlists/traditional-chinese.js +3 -1
- package/dist/node/wordlists/traditional-chinese.js.map +1 -1
- package/dist/node/wordlists/traditional-chinese.mjs +2 -1
- package/dist/node/wordlists/traditional-chinese.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export * from './wordlists';
|
|
2
|
+
/**
|
|
3
|
+
* Generate x random words. Uses Cryptographically-Secure Random Number Generator.
|
|
4
|
+
* @param wordlist imported wordlist for specific language
|
|
5
|
+
* @param strength mnemonic strength 128-256 bits
|
|
6
|
+
* @example
|
|
7
|
+
* generateMnemonic(wordlist, 128)
|
|
8
|
+
* // 'legal winner thank year wave sausage worth useful legal winner thank yellow'
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateMnemonic(wordlist: string[], strength?: number): string;
|
|
11
|
+
/**
|
|
12
|
+
* Reversible: Converts mnemonic string to raw entropy in form of byte array.
|
|
13
|
+
* @param mnemonic 12-24 words
|
|
14
|
+
* @param wordlist imported wordlist for specific language
|
|
15
|
+
* @example
|
|
16
|
+
* const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow';
|
|
17
|
+
* mnemonicToEntropy(mnem, wordlist)
|
|
18
|
+
* // Produces
|
|
19
|
+
* new Uint8Array([
|
|
20
|
+
* 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
|
|
21
|
+
* 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f
|
|
22
|
+
* ])
|
|
23
|
+
*/
|
|
24
|
+
export declare function mnemonicToEntropy(mnemonic: string, wordlist: string[]): Uint8Array;
|
|
25
|
+
/**
|
|
26
|
+
* Reversible: Converts raw entropy in form of byte array to mnemonic string.
|
|
27
|
+
* @param entropy byte array
|
|
28
|
+
* @param wordlist imported wordlist for specific language
|
|
29
|
+
* @returns 12-24 words
|
|
30
|
+
* @example
|
|
31
|
+
* const ent = new Uint8Array([
|
|
32
|
+
* 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
|
|
33
|
+
* 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f
|
|
34
|
+
* ]);
|
|
35
|
+
* entropyToMnemonic(ent, wordlist);
|
|
36
|
+
* // 'legal winner thank year wave sausage worth useful legal winner thank yellow'
|
|
37
|
+
*/
|
|
38
|
+
export declare function entropyToMnemonic(entropy: Uint8Array, wordlist: string[]): string;
|
|
39
|
+
/**
|
|
40
|
+
* Validates mnemonic for being 12-24 words contained in `wordlist`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function validateMnemonic(mnemonic: string, wordlist: string[]): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password.
|
|
45
|
+
* @param mnemonic 12-24 words
|
|
46
|
+
* @param passphrase string that will additionally protect the key
|
|
47
|
+
* @returns 64 bytes of key data
|
|
48
|
+
* @example
|
|
49
|
+
* const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow';
|
|
50
|
+
* await mnemonicToSeed(mnem, 'password');
|
|
51
|
+
* // new Uint8Array([...64 bytes])
|
|
52
|
+
*/
|
|
53
|
+
export declare function mnemonicToSeed(mnemonic: string, passphrase?: string): Promise<Uint8Array>;
|
|
54
|
+
/**
|
|
55
|
+
* Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password.
|
|
56
|
+
* @param mnemonic 12-24 words
|
|
57
|
+
* @param passphrase string that will additionally protect the key
|
|
58
|
+
* @returns 64 bytes of key data
|
|
59
|
+
* @example
|
|
60
|
+
* const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow';
|
|
61
|
+
* mnemonicToSeedSync(mnem, 'password');
|
|
62
|
+
* // new Uint8Array([...64 bytes])
|
|
63
|
+
*/
|
|
64
|
+
export declare function mnemonicToSeedSync(mnemonic: string, passphrase?: string): Uint8Array;
|
|
65
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAUA,cAAc,aAAa,CAAA;AAwB3B;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,QAAQ,SAAM,GAAG,MAAM,CAI3E;AAmBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,UAAU,CAKlF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAIjF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAO9E;AAID;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,SAAK,uBAE/D;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,SAAK,cAEnE"}
|