@net-protocol/cli 0.2.1 → 0.2.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 +113 -3
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/index.mjs.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -365,6 +365,59 @@ netp token info \
|
|
|
365
365
|
--json
|
|
366
366
|
```
|
|
367
367
|
|
|
368
|
+
#### Upvote Command
|
|
369
|
+
|
|
370
|
+
Upvote-related operations for Net Protocol. Run `netp upvote --help` for the
|
|
371
|
+
full list of subcommands (`token`, `info`, `user`, `user-info`, `rankings`).
|
|
372
|
+
|
|
373
|
+
##### Upvote Rankings
|
|
374
|
+
|
|
375
|
+
List the top tokens ranked by upvote activity — the same leaderboard that
|
|
376
|
+
powers the website's `/token/<chain>/trending` page. All reads are live from
|
|
377
|
+
chain; no off-chain index. Callers should cache via HTTP headers.
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
netp upvote rankings \
|
|
381
|
+
[--sort <trending|recent|top>] \
|
|
382
|
+
[--limit <n>] \
|
|
383
|
+
[--scan-window <n>] \
|
|
384
|
+
[--min-upvotes <n>] \
|
|
385
|
+
[--min-market-cap <n>] \
|
|
386
|
+
[--recency-hours <n>] \
|
|
387
|
+
[--chain-id <8453>] \
|
|
388
|
+
[--rpc-url <custom-rpc>] \
|
|
389
|
+
[--json]
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
**Arguments:**
|
|
393
|
+
|
|
394
|
+
- `--sort` (optional): Ranking strategy. `trending` (time-decayed score, recent upvotes weighted higher), `recent` (latest upvote timestamp), `top` (aggregate upvote count). Default: `trending`.
|
|
395
|
+
- `--limit` (optional): Number of tokens to return, 1-100. Default: 50.
|
|
396
|
+
- `--scan-window` (optional): Messages to scan per contract (legacy + 3 strategies). Default: 150.
|
|
397
|
+
- `--min-upvotes` (optional): Two-tier filter floor — tokens with at least this many aggregate upvotes get top slots. Default: 500.
|
|
398
|
+
- `--min-market-cap` (optional): FDV floor in USDC for the top slots. Default: 40000.
|
|
399
|
+
- `--recency-hours` (optional): Drop below-floor tokens with no upvote within N hours. Default: 48.
|
|
400
|
+
- `--chain-id` (optional): Chain ID. Base (8453) is currently the only supported chain.
|
|
401
|
+
- `--rpc-url` (optional): Custom RPC URL.
|
|
402
|
+
- `--json` (optional): Output JSON.
|
|
403
|
+
|
|
404
|
+
**Example:**
|
|
405
|
+
|
|
406
|
+
```bash
|
|
407
|
+
netp upvote rankings --sort top --limit 5 --chain-id 8453
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
Output:
|
|
411
|
+
|
|
412
|
+
```
|
|
413
|
+
Top 5 tokens by top on chain 8453:
|
|
414
|
+
# 1 ALPHA 2238158 upvotes FDV 402.75K $0.000004 0x3d01fe5a...
|
|
415
|
+
# 2 BNKR 133462 upvotes FDV 53.03M $0.000530 0x22af33fe...
|
|
416
|
+
# 3 DICKBUTT 33364 upvotes FDV 388.94K $0.000004 0x2d57c47b...
|
|
417
|
+
# 4 AEGON 33335 upvotes FDV 285.30K $0.000285 0x78a5d1de...
|
|
418
|
+
# 5 DRB 31460 upvotes FDV 4.23M $0.000042 0x3ec2156d...
|
|
419
|
+
```
|
|
420
|
+
|
|
368
421
|
#### Profile Command
|
|
369
422
|
|
|
370
423
|
Profile operations for managing your Net Protocol profile.
|
|
@@ -797,7 +850,7 @@ src/
|
|
|
797
850
|
│ ├── feed/ # Feed command module
|
|
798
851
|
│ ├── message/ # Message command module
|
|
799
852
|
│ ├── token/ # Token command module
|
|
800
|
-
│ ├── bazaar/ #
|
|
853
|
+
│ ├── bazaar/ # Bazaar command module (NFT + ERC-20)
|
|
801
854
|
│ ├── agent/ # Onchain agent command module
|
|
802
855
|
│ ├── relay/ # Relay fund/balance command module
|
|
803
856
|
│ ├── upvote/ # Token/user upvoting command module
|
|
@@ -1077,10 +1130,11 @@ netp relay balance --chain-id 8453 --json
|
|
|
1077
1130
|
|
|
1078
1131
|
#### Bazaar Command
|
|
1079
1132
|
|
|
1080
|
-
|
|
1133
|
+
Bazaar operations — list, buy, sell, and trade NFTs and ERC-20 tokens via Seaport. NFT bazaar is supported on Base (8453) and Ethereum (1); ERC-20 bazaar is supported on Base (8453) and HyperEVM (999).
|
|
1081
1134
|
|
|
1082
1135
|
**Available Subcommands:**
|
|
1083
1136
|
|
|
1137
|
+
NFT:
|
|
1084
1138
|
- `bazaar list-listings` - List active NFT listings
|
|
1085
1139
|
- `bazaar list-offers` - List active collection offers
|
|
1086
1140
|
- `bazaar list-sales` - List recent sales
|
|
@@ -1091,6 +1145,20 @@ NFT Bazaar operations — list, buy, sell, and trade NFTs via Seaport.
|
|
|
1091
1145
|
- `bazaar submit-offer` - Submit a signed offer
|
|
1092
1146
|
- `bazaar buy-listing` - Buy an NFT listing
|
|
1093
1147
|
- `bazaar accept-offer` - Accept a collection offer
|
|
1148
|
+
- `bazaar cancel-listing` - Cancel an NFT listing you created
|
|
1149
|
+
- `bazaar cancel-offer` - Cancel a collection offer you created
|
|
1150
|
+
|
|
1151
|
+
ERC-20:
|
|
1152
|
+
- `bazaar list-erc20-listings` - List active ERC-20 token listings
|
|
1153
|
+
- `bazaar list-erc20-offers` - List active ERC-20 token offers
|
|
1154
|
+
- `bazaar create-erc20-listing` - Create an ERC-20 token listing
|
|
1155
|
+
- `bazaar create-erc20-offer` - Create an ERC-20 token offer
|
|
1156
|
+
- `bazaar submit-erc20-listing` - Submit a signed ERC-20 listing
|
|
1157
|
+
- `bazaar submit-erc20-offer` - Submit a signed ERC-20 offer
|
|
1158
|
+
- `bazaar buy-erc20-listing` - Buy an ERC-20 listing
|
|
1159
|
+
- `bazaar accept-erc20-offer` - Accept an ERC-20 offer
|
|
1160
|
+
- `bazaar cancel-erc20-listing` - Cancel an ERC-20 listing you created
|
|
1161
|
+
- `bazaar cancel-erc20-offer` - Cancel an ERC-20 offer you created
|
|
1094
1162
|
|
|
1095
1163
|
##### Read Commands
|
|
1096
1164
|
|
|
@@ -1106,6 +1174,12 @@ netp bazaar list-sales --nft-address <address> --chain-id 8453 [--json]
|
|
|
1106
1174
|
|
|
1107
1175
|
# Check NFTs owned by an address
|
|
1108
1176
|
netp bazaar owned-nfts --nft-address <address> --owner <address> --chain-id 8453 [--json]
|
|
1177
|
+
|
|
1178
|
+
# List active ERC-20 listings (sorted by price-per-token ascending)
|
|
1179
|
+
netp bazaar list-erc20-listings --token-address <address> --chain-id 8453 [--json]
|
|
1180
|
+
|
|
1181
|
+
# List active ERC-20 offers (sorted by price-per-token descending, balance-validated)
|
|
1182
|
+
netp bazaar list-erc20-offers --token-address <address> --chain-id 8453 [--json]
|
|
1109
1183
|
```
|
|
1110
1184
|
|
|
1111
1185
|
##### Create Commands (Dual Mode)
|
|
@@ -1127,8 +1201,20 @@ netp bazaar create-listing \
|
|
|
1127
1201
|
netp bazaar create-offer \
|
|
1128
1202
|
--nft-address <address> --price <eth> \
|
|
1129
1203
|
--chain-id 8453 --private-key 0x...
|
|
1204
|
+
|
|
1205
|
+
# ERC-20 listing (sell tokens for the chain's native currency) — same dual mode
|
|
1206
|
+
netp bazaar create-erc20-listing \
|
|
1207
|
+
--token-address <address> --token-amount <raw-units> --price <native-amount> \
|
|
1208
|
+
--chain-id 8453 --private-key 0x...
|
|
1209
|
+
|
|
1210
|
+
# ERC-20 offer (bid wrapped native currency for tokens) — same dual mode
|
|
1211
|
+
netp bazaar create-erc20-offer \
|
|
1212
|
+
--token-address <address> --token-amount <raw-units> --price <wrapped-native-amount> \
|
|
1213
|
+
--chain-id 8453 --private-key 0x...
|
|
1130
1214
|
```
|
|
1131
1215
|
|
|
1216
|
+
`--token-amount` is in **raw token units** (bigint string, e.g. `1000000000000000000` for 1.0 of an 18-decimal token). `--price` is the **total** amount of the chain's native currency for ERC-20 listings (ETH on Base, HYPE on HyperEVM), or the **total** wrapped-native amount for ERC-20 offers (WETH on Base, wrapped HYPE on HyperEVM).
|
|
1217
|
+
|
|
1132
1218
|
##### Submit Commands
|
|
1133
1219
|
|
|
1134
1220
|
Follow-up to keyless create commands:
|
|
@@ -1141,6 +1227,15 @@ netp bazaar submit-listing \
|
|
|
1141
1227
|
netp bazaar submit-offer \
|
|
1142
1228
|
--order-data <path> --signature <sig> \
|
|
1143
1229
|
--chain-id 8453 [--private-key 0x... | --encode-only]
|
|
1230
|
+
|
|
1231
|
+
# ERC-20 variants
|
|
1232
|
+
netp bazaar submit-erc20-listing \
|
|
1233
|
+
--order-data <path> --signature <sig> \
|
|
1234
|
+
--chain-id 8453 [--private-key 0x... | --encode-only]
|
|
1235
|
+
|
|
1236
|
+
netp bazaar submit-erc20-offer \
|
|
1237
|
+
--order-data <path> --signature <sig> \
|
|
1238
|
+
--chain-id 8453 [--private-key 0x... | --encode-only]
|
|
1144
1239
|
```
|
|
1145
1240
|
|
|
1146
1241
|
##### Fulfillment Commands
|
|
@@ -1151,10 +1246,21 @@ netp bazaar buy-listing \
|
|
|
1151
1246
|
--order-hash <hash> --nft-address <address> \
|
|
1152
1247
|
--chain-id 8453 [--private-key 0x... | --buyer <address> --encode-only]
|
|
1153
1248
|
|
|
1154
|
-
# Accept an offer (sell your NFT)
|
|
1249
|
+
# Accept an offer (sell your NFT). Fulfillment value is 0 — buyer pays in WETH.
|
|
1155
1250
|
netp bazaar accept-offer \
|
|
1156
1251
|
--order-hash <hash> --nft-address <address> --token-id <id> \
|
|
1157
1252
|
--chain-id 8453 [--private-key 0x... | --seller <address> --encode-only]
|
|
1253
|
+
|
|
1254
|
+
# Buy an ERC-20 listing (pays in the chain's native currency — ETH on Base, HYPE on HyperEVM)
|
|
1255
|
+
netp bazaar buy-erc20-listing \
|
|
1256
|
+
--order-hash <hash> --token-address <address> \
|
|
1257
|
+
--chain-id 8453 [--private-key 0x... | --buyer <address> --encode-only]
|
|
1258
|
+
|
|
1259
|
+
# Accept an ERC-20 offer (sell tokens for wrapped native currency — WETH or wrapped HYPE;
|
|
1260
|
+
# no --token-id, amount comes from the offer; fulfillment value is 0)
|
|
1261
|
+
netp bazaar accept-erc20-offer \
|
|
1262
|
+
--order-hash <hash> --token-address <address> \
|
|
1263
|
+
--chain-id 8453 [--private-key 0x... | --seller <address> --encode-only]
|
|
1158
1264
|
```
|
|
1159
1265
|
|
|
1160
1266
|
##### Encode-Only Mode
|
|
@@ -1179,3 +1285,7 @@ Output:
|
|
|
1179
1285
|
}
|
|
1180
1286
|
}
|
|
1181
1287
|
```
|
|
1288
|
+
|
|
1289
|
+
The `fulfillment.value` is:
|
|
1290
|
+
- The listing price in wei (in the chain's native currency) for NFT or ERC-20 **listing buys**.
|
|
1291
|
+
- **Zero** for **offer accepts** on both sides (NFT collection offers and ERC-20 offers pay in the wrapped native currency, which the offerer pre-approved).
|
package/dist/cli/index.mjs
CHANGED
|
@@ -8891,7 +8891,7 @@ async function executeDm(agentAddress, message, options) {
|
|
|
8891
8891
|
const usingSessionToken = !!(options.sessionToken || process.env.NET_SESSION_TOKEN);
|
|
8892
8892
|
if (usingSessionToken && (!options.topic || !options.topicSignature)) {
|
|
8893
8893
|
exitWithError(
|
|
8894
|
-
"When using --session-token, you must also provide --topic and --topic-signature.\n Obtain the signature with:\n netp agent dm-auth-encode --agent-address <addr> \u2192 produces { typedData, topic }\n [sign .typedData with your external signer
|
|
8894
|
+
"When using --session-token, you must also provide --topic and --topic-signature.\n Obtain the signature with:\n netp agent dm-auth-encode --agent-address <addr> \u2192 produces { typedData, topic }\n [sign .typedData with your external signer]\n Then:\n netp agent dm <addr> <message> --session-token <token> --operator <addr> \\\n --topic <topic> --topic-signature <sig>"
|
|
8895
8895
|
);
|
|
8896
8896
|
}
|
|
8897
8897
|
const auth = await resolveAuth(options);
|