Skip to content

Commit 780b4ed

Browse files
authored
Merge pull request #89 from ethereum/fix-esm-2
2 parents 7d4d7db + f7d9334 commit 780b4ed

File tree

3 files changed

+80
-6
lines changed

3 files changed

+80
-6
lines changed

Diff for: package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
"default": "./aes.js"
4343
},
4444
"./bip39": {
45-
"types": "./bip39.d.ts",
46-
"import": "./esm/bip39.js",
47-
"default": "./bip39.js"
45+
"types": "./bip39/index.d.ts",
46+
"import": "./esm/bip39/index.js",
47+
"default": "./bip39/index.js"
4848
},
4949
"./blake2b": {
5050
"types": "./blake2b.d.ts",
@@ -167,9 +167,9 @@
167167
"default": "./aes.js"
168168
},
169169
"./bip39.js": {
170-
"types": "./bip39.d.ts",
171-
"import": "./esm/bip39.js",
172-
"default": "./bip39.js"
170+
"types": "./bip39/index.d.ts",
171+
"import": "./esm/bip39/index.js",
172+
"default": "./bip39/index.js"
173173
},
174174
"./blake2b.js": {
175175
"types": "./blake2b.d.ts",

Diff for: test/test-imports-1.mjs

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Hashes
2+
import { sha256 } from "ethereum-cryptography/sha256.js";
3+
import { keccak256 } from "ethereum-cryptography/keccak.js";
4+
import { ripemd160 } from "ethereum-cryptography/ripemd160.js";
5+
import { blake2b } from "ethereum-cryptography/blake2b.js";
6+
7+
// KDFs
8+
import { pbkdf2Sync } from "ethereum-cryptography/pbkdf2.js";
9+
import { scryptSync } from "ethereum-cryptography/scrypt.js";
10+
11+
// Random
12+
import { getRandomBytesSync } from "ethereum-cryptography/random.js";
13+
14+
// AES encryption
15+
import { encrypt } from "ethereum-cryptography/aes.js";
16+
17+
// secp256k1 elliptic curve operations
18+
import { secp256k1 } from "ethereum-cryptography/secp256k1.js";
19+
20+
// BIP32 HD Keygen, BIP39 Mnemonic Phrases
21+
import { HDKey } from "ethereum-cryptography/hdkey.js";
22+
import { generateMnemonic as gm1 } from "ethereum-cryptography/bip39.js";
23+
import { generateMnemonic as gm2 } from "ethereum-cryptography/bip39/index.js";
24+
import { wordlist } from "ethereum-cryptography/bip39/wordlists/english.js";
25+
26+
// utilities
27+
import { hexToBytes, toHex, utf8ToBytes } from "ethereum-cryptography/utils.js";
28+
29+
import * as w1 from 'ethereum-cryptography/bip39/wordlists/czech.js';
30+
import * as w2 from 'ethereum-cryptography/bip39/wordlists/english.js';
31+
import * as w3 from 'ethereum-cryptography/bip39/wordlists/french.js';
32+
import * as w4 from 'ethereum-cryptography/bip39/wordlists/italian.js';
33+
import * as w5 from 'ethereum-cryptography/bip39/wordlists/japanese.js';
34+
import * as w6 from 'ethereum-cryptography/bip39/wordlists/korean.js';
35+
import * as w7 from 'ethereum-cryptography/bip39/wordlists/simplified-chinese.js';
36+
import * as w8 from 'ethereum-cryptography/bip39/wordlists/spanish.js';
37+
import * as w9 from 'ethereum-cryptography/bip39/wordlists/traditional-chinese.js';

Diff for: test/test-imports-2.mjs

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Hashes
2+
import { sha256 } from "ethereum-cryptography/sha256";
3+
import { keccak256 } from "ethereum-cryptography/keccak";
4+
import { ripemd160 } from "ethereum-cryptography/ripemd160";
5+
import { blake2b } from "ethereum-cryptography/blake2b";
6+
7+
// KDFs
8+
import { pbkdf2Sync } from "ethereum-cryptography/pbkdf2";
9+
import { scryptSync } from "ethereum-cryptography/scrypt";
10+
11+
// Random
12+
import { getRandomBytesSync } from "ethereum-cryptography/random";
13+
14+
// AES encryption
15+
import { encrypt } from "ethereum-cryptography/aes";
16+
17+
// secp256k1 elliptic curve operations
18+
import { secp256k1 } from "ethereum-cryptography/secp256k1";
19+
20+
// BIP32 HD Keygen, BIP39 Mnemonic Phrases
21+
import { HDKey } from "ethereum-cryptography/hdkey";
22+
import { generateMnemonic as gm1 } from "ethereum-cryptography/bip39";
23+
import { generateMnemonic as gm2 } from "ethereum-cryptography/bip39/index";
24+
import { wordlist } from "ethereum-cryptography/bip39/wordlists/english";
25+
26+
// utilities
27+
import { hexToBytes, toHex, utf8ToBytes } from "ethereum-cryptography/utils";
28+
29+
import * as w1 from 'ethereum-cryptography/bip39/wordlists/czech';
30+
import * as w2 from 'ethereum-cryptography/bip39/wordlists/english';
31+
import * as w3 from 'ethereum-cryptography/bip39/wordlists/french';
32+
import * as w4 from 'ethereum-cryptography/bip39/wordlists/italian';
33+
import * as w5 from 'ethereum-cryptography/bip39/wordlists/japanese';
34+
import * as w6 from 'ethereum-cryptography/bip39/wordlists/korean';
35+
import * as w7 from 'ethereum-cryptography/bip39/wordlists/simplified-chinese';
36+
import * as w8 from 'ethereum-cryptography/bip39/wordlists/spanish';
37+
import * as w9 from 'ethereum-cryptography/bip39/wordlists/traditional-chinese';

0 commit comments

Comments
 (0)