@unicitylabs/sphere-sdk 0.1.4 → 0.1.5
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 +56 -0
- package/dist/core/index.cjs +542 -175
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +32 -6
- package/dist/core/index.d.ts +32 -6
- package/dist/core/index.js +542 -175
- package/dist/core/index.js.map +1 -1
- package/dist/impl/browser/index.cjs +137 -122
- package/dist/impl/browser/index.cjs.map +1 -1
- package/dist/impl/browser/index.js +137 -122
- package/dist/impl/browser/index.js.map +1 -1
- package/dist/impl/browser/ipfs.cjs +28 -33
- package/dist/impl/browser/ipfs.cjs.map +1 -1
- package/dist/impl/browser/ipfs.js +28 -33
- package/dist/impl/browser/ipfs.js.map +1 -1
- package/dist/impl/nodejs/index.cjs +160 -123
- package/dist/impl/nodejs/index.cjs.map +1 -1
- package/dist/impl/nodejs/index.d.cts +11 -2
- package/dist/impl/nodejs/index.d.ts +11 -2
- package/dist/impl/nodejs/index.js +160 -123
- package/dist/impl/nodejs/index.js.map +1 -1
- package/dist/index.cjs +584 -174
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +788 -218
- package/dist/index.d.ts +788 -218
- package/dist/index.js +575 -174
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,6 +30,62 @@ Choose your platform:
|
|
|
30
30
|
|----------|-------|----------|----------|
|
|
31
31
|
| **Browser** | [QUICKSTART-BROWSER.md](docs/QUICKSTART-BROWSER.md) | SDK only | `helia` (IPFS sync) |
|
|
32
32
|
| **Node.js** | [QUICKSTART-NODEJS.md](docs/QUICKSTART-NODEJS.md) | SDK + `ws` | - |
|
|
33
|
+
| **CLI** | See below | SDK + `tsx` | - |
|
|
34
|
+
|
|
35
|
+
## CLI (Command Line Interface)
|
|
36
|
+
|
|
37
|
+
The SDK includes a CLI for quick testing and development:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Show help
|
|
41
|
+
npm run cli -- --help
|
|
42
|
+
|
|
43
|
+
# Initialize new wallet on testnet
|
|
44
|
+
npm run cli -- init --network testnet
|
|
45
|
+
|
|
46
|
+
# Import existing wallet
|
|
47
|
+
npm run cli -- init --mnemonic "your 24 words here"
|
|
48
|
+
|
|
49
|
+
# Check wallet status
|
|
50
|
+
npm run cli -- status
|
|
51
|
+
|
|
52
|
+
# Check balance
|
|
53
|
+
npm run cli -- balance
|
|
54
|
+
|
|
55
|
+
# Show receive address
|
|
56
|
+
npm run cli -- receive
|
|
57
|
+
|
|
58
|
+
# Send tokens
|
|
59
|
+
npm run cli -- send @alice 1000000
|
|
60
|
+
|
|
61
|
+
# Register nametag
|
|
62
|
+
npm run cli -- nametag myname
|
|
63
|
+
|
|
64
|
+
# Show transaction history
|
|
65
|
+
npm run cli -- history 10
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Available CLI Commands
|
|
69
|
+
|
|
70
|
+
| Category | Command | Description |
|
|
71
|
+
|----------|---------|-------------|
|
|
72
|
+
| **Wallet** | `init [--network <net>] [--mnemonic "<words>"]` | Create or import wallet |
|
|
73
|
+
| | `status` | Show wallet identity |
|
|
74
|
+
| | `config` | Show/set configuration |
|
|
75
|
+
| **Balance** | `balance` | Show L3 token balance |
|
|
76
|
+
| | `tokens` | List all tokens |
|
|
77
|
+
| | `l1-balance` | Show L1 (ALPHA) balance |
|
|
78
|
+
| **Transfers** | `send <recipient> <amount>` | Send tokens |
|
|
79
|
+
| | `receive` | Show address for receiving |
|
|
80
|
+
| | `history [limit]` | Show transaction history |
|
|
81
|
+
| **Nametags** | `nametag <name>` | Register a nametag |
|
|
82
|
+
| | `nametag-info <name>` | Lookup nametag info |
|
|
83
|
+
| | `my-nametag` | Show current nametag |
|
|
84
|
+
| **Utils** | `generate-key` | Generate random key |
|
|
85
|
+
| | `to-human <amount>` | Convert to human readable |
|
|
86
|
+
| | `parse-wallet <file>` | Parse wallet file |
|
|
87
|
+
|
|
88
|
+
CLI data is stored in `./.sphere-cli/` directory.
|
|
33
89
|
|
|
34
90
|
## Quick Start
|
|
35
91
|
|