@net-protocol/cli 0.1.0 → 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 +242 -0
- package/dist/cli/index.mjs +991 -53
- package/dist/cli/index.mjs.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -30,6 +30,7 @@ Storage operations for Net Protocol. The `storage` command is a command group wi
|
|
|
30
30
|
|
|
31
31
|
- `storage upload` - Upload files to Net Storage
|
|
32
32
|
- `storage preview` - Preview storage upload without submitting transactions
|
|
33
|
+
- `storage read` - Read data from Net Storage
|
|
33
34
|
|
|
34
35
|
##### Storage Upload
|
|
35
36
|
|
|
@@ -128,6 +129,247 @@ netp storage preview \
|
|
|
128
129
|
⚠ 1 transaction(s) would be sent
|
|
129
130
|
```
|
|
130
131
|
|
|
132
|
+
##### Storage Read
|
|
133
|
+
|
|
134
|
+
Read data from Net Storage by key and operator address.
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
netp storage read \
|
|
138
|
+
--key <storage-key> \
|
|
139
|
+
--operator <address> \
|
|
140
|
+
[--chain-id <8453|1|...>] \
|
|
141
|
+
[--rpc-url <custom-rpc>] \
|
|
142
|
+
[--index <n>] \
|
|
143
|
+
[--json]
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Storage Read Arguments:**
|
|
147
|
+
|
|
148
|
+
- `--key` (required): Storage key to read
|
|
149
|
+
- `--operator` (required): Operator address (wallet that stored the data)
|
|
150
|
+
- `--chain-id` (optional): Chain ID. Can also be set via `NET_CHAIN_ID` environment variable
|
|
151
|
+
- `--rpc-url` (optional): Custom RPC URL. Can also be set via `NET_RPC_URL` environment variable
|
|
152
|
+
- `--index` (optional): Historical version index (0 = oldest). Omit for latest.
|
|
153
|
+
- `--json` (optional): Output in JSON format
|
|
154
|
+
|
|
155
|
+
**Example:**
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Read latest version
|
|
159
|
+
netp storage read \
|
|
160
|
+
--key "my-file" \
|
|
161
|
+
--operator 0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf \
|
|
162
|
+
--chain-id 8453
|
|
163
|
+
|
|
164
|
+
# Read historical version
|
|
165
|
+
netp storage read \
|
|
166
|
+
--key "my-file" \
|
|
167
|
+
--operator 0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf \
|
|
168
|
+
--chain-id 8453 \
|
|
169
|
+
--index 0
|
|
170
|
+
|
|
171
|
+
# JSON output
|
|
172
|
+
netp storage read \
|
|
173
|
+
--key "my-file" \
|
|
174
|
+
--operator 0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf \
|
|
175
|
+
--chain-id 8453 \
|
|
176
|
+
--json
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
##### Encode-Only Mode
|
|
180
|
+
|
|
181
|
+
All write commands support `--encode-only` mode which outputs transaction data as JSON instead of executing transactions. This is useful for:
|
|
182
|
+
- Building transactions to sign with a hardware wallet
|
|
183
|
+
- Integrating with other tools
|
|
184
|
+
- Previewing exact transaction data
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Storage upload encode-only
|
|
188
|
+
netp storage upload \
|
|
189
|
+
--file ./example.txt \
|
|
190
|
+
--key "my-file" \
|
|
191
|
+
--text "Example file" \
|
|
192
|
+
--chain-id 8453 \
|
|
193
|
+
--encode-only
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Output:**
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"storageKey": "my-file",
|
|
201
|
+
"storageType": "normal",
|
|
202
|
+
"operatorAddress": "0x0000000000000000000000000000000000000000",
|
|
203
|
+
"transactions": [
|
|
204
|
+
{
|
|
205
|
+
"to": "0x00000000db40fcb9f4466330982372e27fd7bbf5",
|
|
206
|
+
"data": "0x...",
|
|
207
|
+
"chainId": 8453,
|
|
208
|
+
"value": "0"
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
#### Message Command
|
|
215
|
+
|
|
216
|
+
Message operations for Net Protocol.
|
|
217
|
+
|
|
218
|
+
**Available Subcommands:**
|
|
219
|
+
|
|
220
|
+
- `message send` - Send a message to Net Protocol
|
|
221
|
+
- `message read` - Read messages from Net Protocol
|
|
222
|
+
- `message count` - Get message count
|
|
223
|
+
|
|
224
|
+
##### Message Send
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
netp message send \
|
|
228
|
+
--text <message> \
|
|
229
|
+
[--topic <topic>] \
|
|
230
|
+
[--data <hex>] \
|
|
231
|
+
[--private-key <0x...>] \
|
|
232
|
+
[--chain-id <8453|1|...>] \
|
|
233
|
+
[--encode-only]
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
**Personal Feeds:** Post to any feed with `--topic "feed-<address lowercase>"`. Anyone can post to any feed.
|
|
237
|
+
|
|
238
|
+
##### Message Read
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
netp message read \
|
|
242
|
+
[--app <address>] \
|
|
243
|
+
[--topic <topic>] \
|
|
244
|
+
[--sender <address>] \
|
|
245
|
+
[--limit <n>] \
|
|
246
|
+
[--start <n>] \
|
|
247
|
+
[--end <n>] \
|
|
248
|
+
[--chain-id <8453|1|...>] \
|
|
249
|
+
[--json]
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**Personal Feeds:** Every address has a feed at topic `feed-<address lowercase>`. Use `--topic "feed-0x..."` to read someone's feed.
|
|
253
|
+
|
|
254
|
+
##### Message Count
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
netp message count \
|
|
258
|
+
[--app <address>] \
|
|
259
|
+
[--topic <topic>] \
|
|
260
|
+
[--sender <address>] \
|
|
261
|
+
[--chain-id <8453|1|...>] \
|
|
262
|
+
[--json]
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
#### Token Command
|
|
266
|
+
|
|
267
|
+
Token operations for Netr/Banger tokens (memecoin deployment).
|
|
268
|
+
|
|
269
|
+
**Available Subcommands:**
|
|
270
|
+
|
|
271
|
+
- `token deploy` - Deploy a new Netr token
|
|
272
|
+
- `token info` - Get information about a Netr token
|
|
273
|
+
|
|
274
|
+
##### Token Deploy
|
|
275
|
+
|
|
276
|
+
Deploy a new memecoin with automatic Uniswap V3 pool creation and locked liquidity.
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
netp token deploy \
|
|
280
|
+
--name <name> \
|
|
281
|
+
--symbol <symbol> \
|
|
282
|
+
--image <url> \
|
|
283
|
+
[--animation <url>] \
|
|
284
|
+
[--fid <number>] \
|
|
285
|
+
[--private-key <0x...>] \
|
|
286
|
+
[--chain-id <8453|9745|143|999>] \
|
|
287
|
+
[--encode-only]
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
**Token Deploy Arguments:**
|
|
291
|
+
|
|
292
|
+
- `--name` (required): Token name
|
|
293
|
+
- `--symbol` (required): Token symbol
|
|
294
|
+
- `--image` (required): Token image URL
|
|
295
|
+
- `--animation` (optional): Token animation URL
|
|
296
|
+
- `--fid` (optional): Farcaster ID
|
|
297
|
+
- `--initial-buy` (optional): ETH amount to swap for tokens on deploy (e.g., "0.001")
|
|
298
|
+
- `--private-key` (optional): Private key. Can also be set via `NET_PRIVATE_KEY` environment variable
|
|
299
|
+
- `--chain-id` (optional): Chain ID. Supported: Base (8453), Plasma (9745), Monad (143), HyperEVM (999)
|
|
300
|
+
- `--encode-only` (optional): Output transaction data as JSON instead of executing
|
|
301
|
+
|
|
302
|
+
**Example:**
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
# Deploy token
|
|
306
|
+
netp token deploy \
|
|
307
|
+
--name "My Token" \
|
|
308
|
+
--symbol "MTK" \
|
|
309
|
+
--image "https://example.com/image.png" \
|
|
310
|
+
--chain-id 8453
|
|
311
|
+
|
|
312
|
+
# Deploy with initial buy (swap 0.001 ETH for tokens on deploy)
|
|
313
|
+
netp token deploy \
|
|
314
|
+
--name "My Token" \
|
|
315
|
+
--symbol "MTK" \
|
|
316
|
+
--image "https://example.com/image.png" \
|
|
317
|
+
--initial-buy "0.001" \
|
|
318
|
+
--chain-id 8453
|
|
319
|
+
|
|
320
|
+
# Deploy with animation
|
|
321
|
+
netp token deploy \
|
|
322
|
+
--name "My Token" \
|
|
323
|
+
--symbol "MTK" \
|
|
324
|
+
--image "https://example.com/image.png" \
|
|
325
|
+
--animation "https://example.com/video.mp4" \
|
|
326
|
+
--chain-id 8453
|
|
327
|
+
|
|
328
|
+
# Encode-only (get transaction data without executing)
|
|
329
|
+
netp token deploy \
|
|
330
|
+
--name "My Token" \
|
|
331
|
+
--symbol "MTK" \
|
|
332
|
+
--image "https://example.com/image.png" \
|
|
333
|
+
--chain-id 8453 \
|
|
334
|
+
--encode-only
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
##### Token Info
|
|
338
|
+
|
|
339
|
+
Get information about an existing Netr token.
|
|
340
|
+
|
|
341
|
+
```bash
|
|
342
|
+
netp token info \
|
|
343
|
+
--address <token-address> \
|
|
344
|
+
[--chain-id <8453|9745|143|999>] \
|
|
345
|
+
[--json]
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
**Example:**
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
netp token info \
|
|
352
|
+
--address 0x1234567890abcdef1234567890abcdef12345678 \
|
|
353
|
+
--chain-id 8453 \
|
|
354
|
+
--json
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
#### Info Command
|
|
358
|
+
|
|
359
|
+
Show contract info and stats.
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
netp info [--chain-id <id>] [--json]
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
#### Chains Command
|
|
366
|
+
|
|
367
|
+
List supported chains.
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
netp chains [--json]
|
|
371
|
+
```
|
|
372
|
+
|
|
131
373
|
## Storage Types
|
|
132
374
|
|
|
133
375
|
### Normal Storage
|