dipcoin-cli 1.2.0 → 1.2.1

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 (2) hide show
  1. package/README.md +30 -9
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -20,23 +20,36 @@ npm install -g dipcoin-cli
20
20
 
21
21
  ### Configuration
22
22
 
23
- Create a config file at `~/.config/dipcoin/env` (recommended) or `.env` in your working directory:
23
+ Credentials live in `~/.config/dipcoin/env`. Set them up with one of the two built-in commands — both write the file with `chmod 600` and never echo your private key to the terminal.
24
+
25
+ **Import an existing Sui wallet:**
24
26
 
25
27
  ```bash
26
- mkdir -p ~/.config/dipcoin
27
- cat > ~/.config/dipcoin/env << 'EOF'
28
- DIPCOIN_PRIVATE_KEY=suiprivkey1...
29
- DIPCOIN_NETWORK=mainnet
30
- EOF
28
+ dipcoin-cli setup import # mainnet (default)
29
+ dipcoin-cli setup import --network testnet
31
30
  ```
32
31
 
32
+ You'll be prompted for your `suiprivkey1...` private key with hidden input.
33
+
34
+ **Or generate a new wallet:**
35
+
36
+ ```bash
37
+ dipcoin-cli setup generate # mainnet (default)
38
+ dipcoin-cli setup generate --network testnet
39
+ ```
40
+
41
+ A new Ed25519 keypair is created and saved; the command prints the public Sui address. Transfer USDC on Sui to that address, then run `dipcoin-cli account deposit <amount>` to fund the DEX.
42
+
43
+ #### Config file format
44
+
45
+ The generated `~/.config/dipcoin/env` contains:
46
+
33
47
  | Variable | Required | Description |
34
48
  |----------|----------|-------------|
35
- | `DIPCOIN_PRIVATE_KEY` | One of these | Sui private key (`suiprivkey1...`), supports ED25519/Secp256k1/Secp256r1 |
36
- | `DIPCOIN_MNEMONIC` | is required | 12-word Sui mnemonic phrase (derives keypair at `m/44'/784'/0'/0'/0'`) |
49
+ | `DIPCOIN_PRIVATE_KEY` | Yes | Sui private key (`suiprivkey1...`), supports ED25519/Secp256k1/Secp256r1 |
37
50
  | `DIPCOIN_NETWORK` | No | `mainnet` or `testnet` (default: `mainnet`) |
38
51
 
39
- If both `DIPCOIN_PRIVATE_KEY` and `DIPCOIN_MNEMONIC` are set, the private key takes precedence.
52
+ Manual editing is supported but discouraged — prefer the `setup` commands so format and permissions stay correct.
40
53
 
41
54
  ### Quick Start
42
55
 
@@ -72,6 +85,14 @@ dipcoin-cli history orders --symbol BTC-PERP
72
85
  | `--json` | Output in JSON format (machine-readable) |
73
86
  | `-V, --version` | Show version |
74
87
 
88
+ #### setup
89
+
90
+ ```bash
91
+ dipcoin-cli setup import # Import existing key (hidden prompt)
92
+ dipcoin-cli setup generate # Generate new keypair
93
+ dipcoin-cli setup import --network testnet # Same, on testnet
94
+ ```
95
+
75
96
  #### market
76
97
 
77
98
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dipcoin-cli",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "DipCoin Perpetual Trading CLI",
5
5
  "bin": {
6
6
  "dipcoin-cli": "./dist/cli.cjs"