@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.
Files changed (112) hide show
  1. package/dist/browser/index.d.cts +65 -0
  2. package/dist/browser/index.d.cts.map +1 -0
  3. package/dist/browser/index.js +19 -18485
  4. package/dist/browser/index.js.map +1 -1
  5. package/dist/browser/wordlists/czech.d.cts +2 -0
  6. package/dist/browser/wordlists/czech.d.cts.map +1 -0
  7. package/dist/browser/wordlists/czech.js +1 -2
  8. package/dist/browser/wordlists/czech.js.map +1 -1
  9. package/dist/browser/wordlists/english.d.cts +2 -0
  10. package/dist/browser/wordlists/english.d.cts.map +1 -0
  11. package/dist/browser/wordlists/english.js +1 -2
  12. package/dist/browser/wordlists/english.js.map +1 -1
  13. package/dist/browser/wordlists/french.d.cts +2 -0
  14. package/dist/browser/wordlists/french.d.cts.map +1 -0
  15. package/dist/browser/wordlists/french.js +1 -2
  16. package/dist/browser/wordlists/french.js.map +1 -1
  17. package/dist/browser/wordlists/index.d.cts +12 -0
  18. package/dist/browser/wordlists/index.d.cts.map +1 -0
  19. package/dist/browser/wordlists/index.js +19 -18461
  20. package/dist/browser/wordlists/index.js.map +1 -1
  21. package/dist/browser/wordlists/italian.d.cts +2 -0
  22. package/dist/browser/wordlists/italian.d.cts.map +1 -0
  23. package/dist/browser/wordlists/italian.js +1 -2
  24. package/dist/browser/wordlists/italian.js.map +1 -1
  25. package/dist/browser/wordlists/japanese.d.cts +2 -0
  26. package/dist/browser/wordlists/japanese.d.cts.map +1 -0
  27. package/dist/browser/wordlists/japanese.js +1 -2
  28. package/dist/browser/wordlists/japanese.js.map +1 -1
  29. package/dist/browser/wordlists/korean.d.cts +2 -0
  30. package/dist/browser/wordlists/korean.d.cts.map +1 -0
  31. package/dist/browser/wordlists/korean.js +1 -2
  32. package/dist/browser/wordlists/korean.js.map +1 -1
  33. package/dist/browser/wordlists/simplified-chinese.d.cts +2 -0
  34. package/dist/browser/wordlists/simplified-chinese.d.cts.map +1 -0
  35. package/dist/browser/wordlists/simplified-chinese.js +1 -2
  36. package/dist/browser/wordlists/simplified-chinese.js.map +1 -1
  37. package/dist/browser/wordlists/spanish.d.cts +2 -0
  38. package/dist/browser/wordlists/spanish.d.cts.map +1 -0
  39. package/dist/browser/wordlists/spanish.js +1 -2
  40. package/dist/browser/wordlists/spanish.js.map +1 -1
  41. package/dist/browser/wordlists/traditional-chinese.d.cts +2 -0
  42. package/dist/browser/wordlists/traditional-chinese.d.cts.map +1 -0
  43. package/dist/browser/wordlists/traditional-chinese.js +1 -2
  44. package/dist/browser/wordlists/traditional-chinese.js.map +1 -1
  45. package/dist/docs.json +1057 -0
  46. package/dist/node/index.d.cts +65 -0
  47. package/dist/node/index.d.cts.map +1 -0
  48. package/dist/node/index.js +18487 -21
  49. package/dist/node/index.js.map +1 -1
  50. package/dist/node/index.mjs +18485 -19
  51. package/dist/node/index.mjs.map +1 -1
  52. package/dist/node/wordlists/czech.d.cts +2 -0
  53. package/dist/node/wordlists/czech.d.cts.map +1 -0
  54. package/dist/node/wordlists/czech.js +3 -1
  55. package/dist/node/wordlists/czech.js.map +1 -1
  56. package/dist/node/wordlists/czech.mjs +2 -1
  57. package/dist/node/wordlists/czech.mjs.map +1 -1
  58. package/dist/node/wordlists/english.d.cts +2 -0
  59. package/dist/node/wordlists/english.d.cts.map +1 -0
  60. package/dist/node/wordlists/english.js +3 -1
  61. package/dist/node/wordlists/english.js.map +1 -1
  62. package/dist/node/wordlists/english.mjs +2 -1
  63. package/dist/node/wordlists/english.mjs.map +1 -1
  64. package/dist/node/wordlists/french.d.cts +2 -0
  65. package/dist/node/wordlists/french.d.cts.map +1 -0
  66. package/dist/node/wordlists/french.js +3 -1
  67. package/dist/node/wordlists/french.js.map +1 -1
  68. package/dist/node/wordlists/french.mjs +2 -1
  69. package/dist/node/wordlists/french.mjs.map +1 -1
  70. package/dist/node/wordlists/index.d.cts +12 -0
  71. package/dist/node/wordlists/index.d.cts.map +1 -0
  72. package/dist/node/wordlists/index.js +18464 -19
  73. package/dist/node/wordlists/index.js.map +1 -1
  74. package/dist/node/wordlists/index.mjs +18461 -19
  75. package/dist/node/wordlists/index.mjs.map +1 -1
  76. package/dist/node/wordlists/italian.d.cts +2 -0
  77. package/dist/node/wordlists/italian.d.cts.map +1 -0
  78. package/dist/node/wordlists/italian.js +3 -1
  79. package/dist/node/wordlists/italian.js.map +1 -1
  80. package/dist/node/wordlists/italian.mjs +2 -1
  81. package/dist/node/wordlists/italian.mjs.map +1 -1
  82. package/dist/node/wordlists/japanese.d.cts +2 -0
  83. package/dist/node/wordlists/japanese.d.cts.map +1 -0
  84. package/dist/node/wordlists/japanese.js +3 -1
  85. package/dist/node/wordlists/japanese.js.map +1 -1
  86. package/dist/node/wordlists/japanese.mjs +2 -1
  87. package/dist/node/wordlists/japanese.mjs.map +1 -1
  88. package/dist/node/wordlists/korean.d.cts +2 -0
  89. package/dist/node/wordlists/korean.d.cts.map +1 -0
  90. package/dist/node/wordlists/korean.js +3 -1
  91. package/dist/node/wordlists/korean.js.map +1 -1
  92. package/dist/node/wordlists/korean.mjs +2 -1
  93. package/dist/node/wordlists/korean.mjs.map +1 -1
  94. package/dist/node/wordlists/simplified-chinese.d.cts +2 -0
  95. package/dist/node/wordlists/simplified-chinese.d.cts.map +1 -0
  96. package/dist/node/wordlists/simplified-chinese.js +3 -1
  97. package/dist/node/wordlists/simplified-chinese.js.map +1 -1
  98. package/dist/node/wordlists/simplified-chinese.mjs +2 -1
  99. package/dist/node/wordlists/simplified-chinese.mjs.map +1 -1
  100. package/dist/node/wordlists/spanish.d.cts +2 -0
  101. package/dist/node/wordlists/spanish.d.cts.map +1 -0
  102. package/dist/node/wordlists/spanish.js +3 -1
  103. package/dist/node/wordlists/spanish.js.map +1 -1
  104. package/dist/node/wordlists/spanish.mjs +2 -1
  105. package/dist/node/wordlists/spanish.mjs.map +1 -1
  106. package/dist/node/wordlists/traditional-chinese.d.cts +2 -0
  107. package/dist/node/wordlists/traditional-chinese.d.cts.map +1 -0
  108. package/dist/node/wordlists/traditional-chinese.js +3 -1
  109. package/dist/node/wordlists/traditional-chinese.js.map +1 -1
  110. package/dist/node/wordlists/traditional-chinese.mjs +2 -1
  111. package/dist/node/wordlists/traditional-chinese.mjs.map +1 -1
  112. 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"}