@unifiedflow/cli 1.0.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/README.md +85 -0
- package/dist/idl/unified_flow.json +1889 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +443 -0
- package/dist/index.js.map +1 -0
- package/dist/services/backfill.d.ts +2 -0
- package/dist/services/backfill.d.ts.map +1 -0
- package/dist/services/backfill.js +358 -0
- package/dist/services/backfill.js.map +1 -0
- package/dist/services/csvDiff.d.ts +68 -0
- package/dist/services/csvDiff.d.ts.map +1 -0
- package/dist/services/csvDiff.js +318 -0
- package/dist/services/csvDiff.js.map +1 -0
- package/dist/services/decoder.d.ts +3 -0
- package/dist/services/decoder.d.ts.map +1 -0
- package/dist/services/decoder.js +43 -0
- package/dist/services/decoder.js.map +1 -0
- package/dist/services/eventNormalizer.d.ts +63 -0
- package/dist/services/eventNormalizer.d.ts.map +1 -0
- package/dist/services/eventNormalizer.js +212 -0
- package/dist/services/eventNormalizer.js.map +1 -0
- package/dist/services/eventParser.d.ts +7 -0
- package/dist/services/eventParser.d.ts.map +1 -0
- package/dist/services/eventParser.js +130 -0
- package/dist/services/eventParser.js.map +1 -0
- package/dist/services/rpc.d.ts +10 -0
- package/dist/services/rpc.d.ts.map +1 -0
- package/dist/services/rpc.js +203 -0
- package/dist/services/rpc.js.map +1 -0
- package/dist/services/streamIndexer.d.ts +2 -0
- package/dist/services/streamIndexer.d.ts.map +1 -0
- package/dist/services/streamIndexer.js +367 -0
- package/dist/services/streamIndexer.js.map +1 -0
- package/package.json +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# @unifiedflow/cli
|
|
2
|
+
|
|
3
|
+
CLI tool for Unified Flow token distribution protocol on Solana.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @unifiedflow/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
unifiedflow <command> [args...]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Commands
|
|
18
|
+
|
|
19
|
+
#### Read Commands
|
|
20
|
+
- `view <streamAddress>` - Fetch & print real-time on-chain stream & milestone details
|
|
21
|
+
- `config` - Print global protocol config (fees, admin, paused state)
|
|
22
|
+
|
|
23
|
+
#### Write Transaction Commands
|
|
24
|
+
- `init` - Initialize global protocol config PDA state
|
|
25
|
+
- `create <recipient> <mint> <amount> <type> [duration|milestones...]` - Create a new vesting stream
|
|
26
|
+
- Vesting types:
|
|
27
|
+
- `0` - Linear (args: `<durationSecs>`)
|
|
28
|
+
- `1` - Cliff (args: `<durationSecs>`)
|
|
29
|
+
- `2` - Milestone (args: comma-separated list of milestone amounts)
|
|
30
|
+
- `withdraw <streamAddress>` - Withdraw claimable vested tokens from a stream
|
|
31
|
+
- `cancel <streamAddress>` - Cancel an active stream (returns unvested tokens to creator)
|
|
32
|
+
- `unlock <streamAddress>` - Unlock the next milestone in a milestone stream
|
|
33
|
+
- `edit-milestone <stream> <idx> <amt>` - Modify a locked milestone allocation
|
|
34
|
+
- `edit-cliff <stream> <newCliffTs>` - Edit stream's cliff timestamp
|
|
35
|
+
|
|
36
|
+
### Environment Variables
|
|
37
|
+
|
|
38
|
+
Create a `.env` file or set environment variables:
|
|
39
|
+
|
|
40
|
+
- `WALLET_PATH` - Path to your Solana wallet keypair file (default: `~/.config/solana/id.json`)
|
|
41
|
+
- `PROGRAM_ID` - Unified Flow program ID (default: `8M5yieUh7pxwUi1YBByDF82nqoorZwaKi8dBoMVpurFa`)
|
|
42
|
+
- `RPC_URL` - Solana RPC endpoint URL
|
|
43
|
+
|
|
44
|
+
### Examples
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# View stream details
|
|
48
|
+
unifiedflow view 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
|
|
49
|
+
|
|
50
|
+
# Create a linear vesting stream (1 year duration)
|
|
51
|
+
unifiedflow create <recipient_address> <mint_address> 1000000000 0 31536000
|
|
52
|
+
|
|
53
|
+
# Create a milestone-based vesting stream
|
|
54
|
+
unifiedflow create <recipient_address> <mint_address> 1000000000 2 250000000,250000000,250000000,250000000
|
|
55
|
+
|
|
56
|
+
# Withdraw available tokens
|
|
57
|
+
unifiedflow withdraw 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
|
|
58
|
+
|
|
59
|
+
# Cancel a stream
|
|
60
|
+
unifiedflow cancel 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Development
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Build the CLI
|
|
67
|
+
npm run build
|
|
68
|
+
|
|
69
|
+
# Run locally
|
|
70
|
+
npm start -- <command> [args...]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Publishing to NPM
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Build the package
|
|
77
|
+
npm run build
|
|
78
|
+
|
|
79
|
+
# Publish to npm
|
|
80
|
+
npm publish
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
ISC
|