@mingderwang/wallet 0.1.1 → 0.1.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/README.md +22 -3
- package/dist/cli.js +23966 -0
- package/dist/index.js +5 -0
- package/package.json +6 -3
- package/src/cli.ts +331 -0
- package/src/index.ts +5 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @mingderwang/wallet
|
|
2
2
|
|
|
3
|
-
Ethereum wallet + encrypted keystore helpers for Node.js, built on ethers v6.
|
|
3
|
+
Ethereum wallet + encrypted keystore helpers for Node.js, built on ethers v6. Ships both a library and a `wallet` CLI.
|
|
4
4
|
|
|
5
5
|
- Create / import / load wallets (private key + mnemonic)
|
|
6
6
|
- Encrypted keystore: scrypt (N=2^15, r=8, p=1) + AES-256-GCM, stored at a path of your choice
|
|
@@ -12,10 +12,29 @@ Used by `@mingderwang/xsift` and `@mingderwang/x402`.
|
|
|
12
12
|
## Install
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
npm install @mingderwang/wallet
|
|
15
|
+
npm install @mingderwang/wallet # library
|
|
16
|
+
npm install -g @mingderwang/wallet # also gives the `wallet` CLI
|
|
16
17
|
```
|
|
17
18
|
|
|
18
|
-
##
|
|
19
|
+
## CLI
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
wallet create [--path <file>] [--json]
|
|
23
|
+
wallet import <mnemonic | private key> [--path <file>] [--json]
|
|
24
|
+
wallet address [--path <file>]
|
|
25
|
+
wallet balance [--path <file>] [--network <ethereum-sepolia|ethereum-mainnet|base-sepolia|base>]
|
|
26
|
+
wallet export [--path <file>]
|
|
27
|
+
wallet delete [--path <file>]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Keystore defaults to `~/.wallet/wallet.json`. Prompts for the password, or set `WALLET_PASSWORD` in the environment to script it.
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
WALLET_PASSWORD=hunter2 wallet create
|
|
34
|
+
wallet address
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Library
|
|
19
38
|
|
|
20
39
|
```ts
|
|
21
40
|
import { createWallet, encryptPrivateKey, saveKeystore, loadWallet, readKeystore, getBalances } from '@mingderwang/wallet';
|