@graveyardprotocol/gp-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/LICENSE.md ADDED
@@ -0,0 +1,35 @@
1
+ # Proprietary Software License Agreement
2
+ Version 1.0, March 2026
3
+ #### *Copyright: © 2026 Graveyard Protocol. All rights reserved.*
4
+
5
+ ---
6
+
7
+ ## Product: Graveyard Protocol CLI
8
+
9
+ **1. GRANT OF LICENSE**
10
+
11
+ Graveyard Protocol ("Owner") grants you a non-exclusive, non-transferable license to download, install, and use the Graveyard Protocol CLI ("Software") solely for your personal or internal business purposes, subject to the terms of this Agreement.
12
+
13
+ **2. RESTRICTIONS**
14
+
15
+ You shall not, and shall not permit any third party to:
16
+
17
+ - **Reverse Engineer:** Decompile, disassemble, reverse engineer, or otherwise attempt to derive the source code of the Software.
18
+
19
+ - **Redistribute:** Copy, rent, lease, sub-license, or distribute the Software or any portion thereof to any third party.
20
+
21
+ - **Modify:** Create derivative works or modifications of the Software.
22
+
23
+ - **Remove Notices:** Remove or alter any copyright, trademark, or proprietary notices contained in the Software.
24
+
25
+ **3. OWNERSHIP**
26
+
27
+ The Software, including its object code and any obfuscated source code published via package managers (e.g., npm), remains the sole and exclusive property of the Owner. This license does not grant you any ownership rights.
28
+
29
+ **4. THIRD-PARTY LICENSES**
30
+
31
+ The Software utilizes third-party open-source libraries (including but not limited to *@solana/web3.js, commander, and inquirer*). These components are used in accordance with their respective MIT or Apache 2.0 licenses. A list of these attributions is included in the THIRD_PARTY_LICENSES file provided with this distribution.
32
+
33
+ **5. TERMINATION**
34
+
35
+ This license is effective until terminated. Your rights under this license will terminate automatically without notice if you fail to comply with any term(s) of this Agreement.
package/README.md ADDED
@@ -0,0 +1,144 @@
1
+ # GP-CLI — Graveyard Protocol Command Line Interface
2
+
3
+ Close empty Solana SPL token accounts and reclaim the locked rent (SOL) back to your wallet.
4
+
5
+ ---
6
+
7
+ ## Requirements
8
+
9
+ - **Node.js 18+**
10
+ - A Solana wallet private key (JSON byte array or Base58 string)
11
+
12
+ ---
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install -g @graveyardprotocol/gp-cli
18
+ ```
19
+
20
+ Or run directly from the repo:
21
+
22
+ ```bash
23
+ git clone https://github.com/GraveyardProtocol/gp-cli
24
+ cd gp-cli
25
+ npm install
26
+ npm link
27
+ ```
28
+
29
+ ---
30
+
31
+ ## Quick Start
32
+
33
+ ### 1. Add a wallet
34
+
35
+ ```bash
36
+ gp add-wallet
37
+ ```
38
+
39
+ You will be prompted for your private key. Both formats are accepted:
40
+
41
+ | Format | Example |
42
+ |---|---|
43
+ | JSON byte array | `[12, 34, 56, ...]` — exported by Phantom / Solflare |
44
+ | Base58 string | `5Jxyz...` — some wallet exporters |
45
+
46
+ Your private key is **never stored in plaintext**. It is encrypted with AES-256-GCM using a password you choose, and stored in `~/.gp-cli/wallets.json`.
47
+
48
+ ### 2. Close empty token accounts
49
+
50
+ ```bash
51
+ gp close-empty
52
+ ```
53
+
54
+ You will be shown a scan summary and asked to confirm before any transaction is submitted.
55
+
56
+ ---
57
+
58
+ ## All Commands
59
+
60
+ | Command | Description |
61
+ |---|---|
62
+ | `gp add-wallet` | Add and encrypt a Solana wallet |
63
+ | `gp remove-wallet` | Remove a saved wallet |
64
+ | `gp list-wallets` | Show all saved wallet public keys |
65
+ | `gp close-empty` | Scan and close empty token accounts |
66
+ | `gp close-empty --dry-run` | Preview what would be closed — no transactions sent |
67
+ | `gp close-empty --all` | Process every saved wallet in sequence |
68
+
69
+ ---
70
+
71
+ ## How It Works
72
+
73
+ ```
74
+ CLI Backend Solana
75
+ │ │ │
76
+ ├─ gp close-empty │ │
77
+ │ │ │
78
+ ├──── GET /scan/{wallet} ───────► │
79
+ │◄─── { total_accounts, SOL } ──┤ scans on-chain ──────────►
80
+ │ │◄─ results ─────────────────┤
81
+ │ │ │
82
+ ├──── GET /getBatchCount ───────► │
83
+ │◄─── { totalBatches } ─────────┤ │
84
+ │ │ │
85
+ ├──── POST /processBatch ───────► │
86
+ │◄─── { intentID, ─┤ builds instructions │
87
+ │ instructionsBatch } │ │
88
+ │ │ │
89
+ ├── build Tx, sign locally ─────► │
90
+ │ │ │
91
+ ├──── POST /executeBatch ───────► │
92
+ │◄─── { txSignature, SOL } ─────┤ simulates + submits ──────►
93
+ │ │◄─ confirmed ───────────────┤
94
+ ```
95
+
96
+ **The CLI never broadcasts to Solana directly.** Signing happens locally with your decrypted keypair; the signed transaction is handed to backend API which simulates, sends, and confirms it.
97
+
98
+ ---
99
+
100
+ ## Protocol Economics
101
+
102
+ | Item | Value |
103
+ |---|---|
104
+ | Protocol fee | 20% of reclaimed rent per batch |
105
+ | You receive | ~80% of total locked SOL |
106
+ | Ghost Points | 100 points per closed account |
107
+ | Average rent per account | ~0.00204 SOL |
108
+
109
+ ---
110
+
111
+ ## Security
112
+
113
+ - Private keys encrypted with **AES-256-GCM**
114
+ - Key derived via **PBKDF2** (SHA-256, 100,000 iterations)
115
+ - Stored at `~/.gp-cli/wallets.json` — never transmitted
116
+ - GCM authentication tag prevents ciphertext tampering
117
+
118
+ ---
119
+
120
+ ## Local Storage
121
+
122
+ | Path | Contents |
123
+ |---|---|
124
+ | `~/.gp-cli/wallets.json` | Encrypted wallet entries |
125
+
126
+ ---
127
+
128
+ **Note:** The source code provided in this repository is for transparency and auditing purposes only. It does not constitute an Open Source grant.
129
+
130
+ ---
131
+
132
+ ## License
133
+
134
+ **Graveyard Protocol CLI** (gp-cli) is proprietary software. All rights reserved.
135
+
136
+ The use of this software is governed by the **Proprietary Software License Agreement** found in the LICENSE file included in this repository.
137
+
138
+ **Commercial Use:** Permitted under the terms of the license.
139
+
140
+ **Modification/Redistribution:** Strictly prohibited.
141
+
142
+ **Reverse Engineering:** Strictly prohibited.
143
+
144
+ For third-party library attributions, please refer to the THIRD_PARTY_LICENSES file generated in the distribution.