@xyo-network/bip39 2.107.6 → 2.109.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/browser/index.cjs +28 -18485
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +0 -2
- package/dist/browser/index.d.cts.map +1 -1
- package/dist/browser/index.d.mts +0 -2
- package/dist/browser/index.d.mts.map +1 -1
- package/dist/browser/index.d.ts +0 -2
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +28 -18485
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/wordlists/index.d.cts +18 -9
- package/dist/browser/wordlists/index.d.cts.map +1 -1
- package/dist/browser/wordlists/index.d.mts +18 -9
- package/dist/browser/wordlists/index.d.mts.map +1 -1
- package/dist/browser/wordlists/index.d.ts +18 -9
- package/dist/browser/wordlists/index.d.ts.map +1 -1
- package/dist/neutral/index.cjs +28 -18485
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.d.cts +0 -2
- package/dist/neutral/index.d.cts.map +1 -1
- package/dist/neutral/index.d.mts +0 -2
- package/dist/neutral/index.d.mts.map +1 -1
- package/dist/neutral/index.d.ts +0 -2
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.js +28 -18485
- package/dist/neutral/index.js.map +1 -1
- package/dist/neutral/wordlists/index.d.cts +18 -9
- package/dist/neutral/wordlists/index.d.cts.map +1 -1
- package/dist/neutral/wordlists/index.d.mts +18 -9
- package/dist/neutral/wordlists/index.d.mts.map +1 -1
- package/dist/neutral/wordlists/index.d.ts +18 -9
- package/dist/neutral/wordlists/index.d.ts.map +1 -1
- package/dist/node/index.cjs +28 -18487
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +0 -2
- package/dist/node/index.d.cts.map +1 -1
- package/dist/node/index.d.mts +0 -2
- package/dist/node/index.d.mts.map +1 -1
- package/dist/node/index.d.ts +0 -2
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +28 -18485
- package/dist/node/index.js.map +1 -1
- package/dist/node/wordlists/index.d.cts +18 -9
- package/dist/node/wordlists/index.d.cts.map +1 -1
- package/dist/node/wordlists/index.d.mts +18 -9
- package/dist/node/wordlists/index.d.mts.map +1 -1
- package/dist/node/wordlists/index.d.ts +18 -9
- package/dist/node/wordlists/index.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/index.ts +1 -31
- package/src/wordlists/index.ts +10 -9
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
import czech from '@scure/bip39/wordlists/czech';
|
|
2
|
+
import english from '@scure/bip39/wordlists/english';
|
|
3
|
+
import french from '@scure/bip39/wordlists/french';
|
|
4
|
+
import italian from '@scure/bip39/wordlists/italian';
|
|
5
|
+
import japanese from '@scure/bip39/wordlists/japanese';
|
|
6
|
+
import korean from '@scure/bip39/wordlists/korean';
|
|
7
|
+
import simplifiedChinese from '@scure/bip39/wordlists/simplified-chinese';
|
|
8
|
+
import spanish from '@scure/bip39/wordlists/spanish';
|
|
9
|
+
import traditionalChinese from '@scure/bip39/wordlists/traditional-chinese';
|
|
1
10
|
export declare const wordlists: {
|
|
2
|
-
czech:
|
|
3
|
-
english:
|
|
4
|
-
french:
|
|
5
|
-
italian:
|
|
6
|
-
japanese:
|
|
7
|
-
korean:
|
|
8
|
-
simplifiedChinese:
|
|
9
|
-
spanish:
|
|
10
|
-
traditionalChinese:
|
|
11
|
+
czech: typeof czech;
|
|
12
|
+
english: typeof english;
|
|
13
|
+
french: typeof french;
|
|
14
|
+
italian: typeof italian;
|
|
15
|
+
japanese: typeof japanese;
|
|
16
|
+
korean: typeof korean;
|
|
17
|
+
simplifiedChinese: typeof simplifiedChinese;
|
|
18
|
+
spanish: typeof spanish;
|
|
19
|
+
traditionalChinese: typeof traditionalChinese;
|
|
11
20
|
};
|
|
12
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wordlists/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wordlists/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,8BAA8B,CAAA;AAChD,OAAO,OAAO,MAAM,gCAAgC,CAAA;AACpD,OAAO,MAAM,MAAM,+BAA+B,CAAA;AAClD,OAAO,OAAO,MAAM,gCAAgC,CAAA;AACpD,OAAO,QAAQ,MAAM,iCAAiC,CAAA;AACtD,OAAO,MAAM,MAAM,+BAA+B,CAAA;AAClD,OAAO,iBAAiB,MAAM,2CAA2C,CAAA;AACzE,OAAO,OAAO,MAAM,gCAAgC,CAAA;AACpD,OAAO,kBAAkB,MAAM,4CAA4C,CAAA;AAG3E,eAAO,MAAM,SAAS;;;;;;;;;;CAUrB,CAAA"}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
import czech from '@scure/bip39/wordlists/czech';
|
|
2
|
+
import english from '@scure/bip39/wordlists/english';
|
|
3
|
+
import french from '@scure/bip39/wordlists/french';
|
|
4
|
+
import italian from '@scure/bip39/wordlists/italian';
|
|
5
|
+
import japanese from '@scure/bip39/wordlists/japanese';
|
|
6
|
+
import korean from '@scure/bip39/wordlists/korean';
|
|
7
|
+
import simplifiedChinese from '@scure/bip39/wordlists/simplified-chinese';
|
|
8
|
+
import spanish from '@scure/bip39/wordlists/spanish';
|
|
9
|
+
import traditionalChinese from '@scure/bip39/wordlists/traditional-chinese';
|
|
1
10
|
export declare const wordlists: {
|
|
2
|
-
czech:
|
|
3
|
-
english:
|
|
4
|
-
french:
|
|
5
|
-
italian:
|
|
6
|
-
japanese:
|
|
7
|
-
korean:
|
|
8
|
-
simplifiedChinese:
|
|
9
|
-
spanish:
|
|
10
|
-
traditionalChinese:
|
|
11
|
+
czech: typeof czech;
|
|
12
|
+
english: typeof english;
|
|
13
|
+
french: typeof french;
|
|
14
|
+
italian: typeof italian;
|
|
15
|
+
japanese: typeof japanese;
|
|
16
|
+
korean: typeof korean;
|
|
17
|
+
simplifiedChinese: typeof simplifiedChinese;
|
|
18
|
+
spanish: typeof spanish;
|
|
19
|
+
traditionalChinese: typeof traditionalChinese;
|
|
11
20
|
};
|
|
12
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wordlists/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wordlists/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,8BAA8B,CAAA;AAChD,OAAO,OAAO,MAAM,gCAAgC,CAAA;AACpD,OAAO,MAAM,MAAM,+BAA+B,CAAA;AAClD,OAAO,OAAO,MAAM,gCAAgC,CAAA;AACpD,OAAO,QAAQ,MAAM,iCAAiC,CAAA;AACtD,OAAO,MAAM,MAAM,+BAA+B,CAAA;AAClD,OAAO,iBAAiB,MAAM,2CAA2C,CAAA;AACzE,OAAO,OAAO,MAAM,gCAAgC,CAAA;AACpD,OAAO,kBAAkB,MAAM,4CAA4C,CAAA;AAG3E,eAAO,MAAM,SAAS;;;;;;;;;;CAUrB,CAAA"}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
import czech from '@scure/bip39/wordlists/czech';
|
|
2
|
+
import english from '@scure/bip39/wordlists/english';
|
|
3
|
+
import french from '@scure/bip39/wordlists/french';
|
|
4
|
+
import italian from '@scure/bip39/wordlists/italian';
|
|
5
|
+
import japanese from '@scure/bip39/wordlists/japanese';
|
|
6
|
+
import korean from '@scure/bip39/wordlists/korean';
|
|
7
|
+
import simplifiedChinese from '@scure/bip39/wordlists/simplified-chinese';
|
|
8
|
+
import spanish from '@scure/bip39/wordlists/spanish';
|
|
9
|
+
import traditionalChinese from '@scure/bip39/wordlists/traditional-chinese';
|
|
1
10
|
export declare const wordlists: {
|
|
2
|
-
czech:
|
|
3
|
-
english:
|
|
4
|
-
french:
|
|
5
|
-
italian:
|
|
6
|
-
japanese:
|
|
7
|
-
korean:
|
|
8
|
-
simplifiedChinese:
|
|
9
|
-
spanish:
|
|
10
|
-
traditionalChinese:
|
|
11
|
+
czech: typeof czech;
|
|
12
|
+
english: typeof english;
|
|
13
|
+
french: typeof french;
|
|
14
|
+
italian: typeof italian;
|
|
15
|
+
japanese: typeof japanese;
|
|
16
|
+
korean: typeof korean;
|
|
17
|
+
simplifiedChinese: typeof simplifiedChinese;
|
|
18
|
+
spanish: typeof spanish;
|
|
19
|
+
traditionalChinese: typeof traditionalChinese;
|
|
11
20
|
};
|
|
12
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wordlists/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wordlists/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,8BAA8B,CAAA;AAChD,OAAO,OAAO,MAAM,gCAAgC,CAAA;AACpD,OAAO,MAAM,MAAM,+BAA+B,CAAA;AAClD,OAAO,OAAO,MAAM,gCAAgC,CAAA;AACpD,OAAO,QAAQ,MAAM,iCAAiC,CAAA;AACtD,OAAO,MAAM,MAAM,+BAA+B,CAAA;AAClD,OAAO,iBAAiB,MAAM,2CAA2C,CAAA;AACzE,OAAO,OAAO,MAAM,gCAAgC,CAAA;AACpD,OAAO,kBAAkB,MAAM,4CAA4C,CAAA;AAG3E,eAAO,MAAM,SAAS;;;;;;;;;;CAUrB,CAAA"}
|
package/package.json
CHANGED
|
@@ -10,14 +10,15 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@noble/hashes": "
|
|
14
|
-
"@scure/base": "
|
|
13
|
+
"@noble/hashes": "^1.4.0",
|
|
14
|
+
"@scure/base": "^1.1.7",
|
|
15
|
+
"@scure/bip39": "^1.3.0"
|
|
15
16
|
},
|
|
16
17
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
17
18
|
"devDependencies": {
|
|
18
19
|
"@xylabs/ts-scripts-yarn3": "^3.11.12",
|
|
19
20
|
"@xylabs/tsconfig": "^3.11.12",
|
|
20
|
-
"typescript": "^5.5.
|
|
21
|
+
"typescript": "^5.5.3"
|
|
21
22
|
},
|
|
22
23
|
"exports": {
|
|
23
24
|
".": {
|
|
@@ -57,6 +58,6 @@
|
|
|
57
58
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
58
59
|
},
|
|
59
60
|
"sideEffects": false,
|
|
60
|
-
"version": "2.
|
|
61
|
+
"version": "2.109.0",
|
|
61
62
|
"type": "module"
|
|
62
63
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
/* eslint-disable import/no-internal-modules */
|
|
1
2
|
/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */
|
|
2
3
|
import assert from '@noble/hashes/_assert'
|
|
3
4
|
import { pbkdf2, pbkdf2Async } from '@noble/hashes/pbkdf2'
|
|
4
5
|
import { sha256 } from '@noble/hashes/sha256'
|
|
5
6
|
import { sha512 } from '@noble/hashes/sha512'
|
|
6
|
-
import { randomBytes } from '@noble/hashes/utils'
|
|
7
7
|
import { utils as baseUtils } from '@scure/base'
|
|
8
8
|
|
|
9
9
|
export * from './wordlists'
|
|
@@ -30,22 +30,6 @@ function assertEntropy(entropy: Uint8Array) {
|
|
|
30
30
|
assert.bytes(entropy, 16, 20, 24, 28, 32)
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
/**
|
|
34
|
-
* Generate x random words. Uses Cryptographically-Secure Random Number Generator.
|
|
35
|
-
* @param wordlist imported wordlist for specific language
|
|
36
|
-
* @param strength mnemonic strength 128-256 bits
|
|
37
|
-
* @example
|
|
38
|
-
* generateMnemonic(wordlist, 128)
|
|
39
|
-
* // 'legal winner thank year wave sausage worth useful legal winner thank yellow'
|
|
40
|
-
*/
|
|
41
|
-
/** @deprecated use @scure/bip39 instead */
|
|
42
|
-
export function generateMnemonic(wordlist: string[], strength = 128): string {
|
|
43
|
-
assert.number(strength)
|
|
44
|
-
if (strength % 32 !== 0 || strength > 256) throw new TypeError('Invalid entropy')
|
|
45
|
-
|
|
46
|
-
return entropyToMnemonic(randomBytes(strength / 8), wordlist)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
33
|
const calcChecksum = (entropy: Uint8Array) => {
|
|
50
34
|
// Checksum is ent.length/4 bits long
|
|
51
35
|
const bitsLeft = 8 - entropy.length / 4
|
|
@@ -106,20 +90,6 @@ export function entropyToMnemonic(entropy: Uint8Array, wordlist: string[]): stri
|
|
|
106
90
|
return words.join(isJapanese(wordlist) ? '\u3000' : ' ')
|
|
107
91
|
}
|
|
108
92
|
|
|
109
|
-
/**
|
|
110
|
-
* Validates mnemonic for being 12-24 words contained in `wordlist`.
|
|
111
|
-
*/
|
|
112
|
-
|
|
113
|
-
/** @deprecated use @scure/bip39 instead */
|
|
114
|
-
export function validateMnemonic(mnemonic: string, wordlist: string[]): boolean {
|
|
115
|
-
try {
|
|
116
|
-
mnemonicToEntropy(mnemonic, wordlist)
|
|
117
|
-
} catch {
|
|
118
|
-
return false
|
|
119
|
-
}
|
|
120
|
-
return true
|
|
121
|
-
}
|
|
122
|
-
|
|
123
93
|
const salt = (passphrase: string) => nfkd(`mnemonic${passphrase}`)
|
|
124
94
|
|
|
125
95
|
/**
|
package/src/wordlists/index.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
/* eslint-disable import/no-internal-modules */
|
|
2
|
+
import czech from '@scure/bip39/wordlists/czech'
|
|
3
|
+
import english from '@scure/bip39/wordlists/english'
|
|
4
|
+
import french from '@scure/bip39/wordlists/french'
|
|
5
|
+
import italian from '@scure/bip39/wordlists/italian'
|
|
6
|
+
import japanese from '@scure/bip39/wordlists/japanese'
|
|
7
|
+
import korean from '@scure/bip39/wordlists/korean'
|
|
8
|
+
import simplifiedChinese from '@scure/bip39/wordlists/simplified-chinese'
|
|
9
|
+
import spanish from '@scure/bip39/wordlists/spanish'
|
|
10
|
+
import traditionalChinese from '@scure/bip39/wordlists/traditional-chinese'
|
|
10
11
|
|
|
11
12
|
/** @deprecated use @scure/bip39 instead */
|
|
12
13
|
export const wordlists = {
|