opensea-cli 0.1.5 → 0.2.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/package.json +3 -41
- package/postinstall.js +11 -0
- package/README.md +0 -261
- package/dist/cli.js +0 -530
- package/dist/cli.js.map +0 -1
- package/dist/index.d.ts +0 -493
- package/dist/index.js +0 -293
- package/dist/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,48 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opensea-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "OpenSea CLI - Query the OpenSea API from the command line or programmatically",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"bin": {
|
|
9
|
-
"opensea": "dist/cli.js"
|
|
10
|
-
},
|
|
11
|
-
"files": [
|
|
12
|
-
"dist"
|
|
13
|
-
],
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "This package has moved to @opensea/cli",
|
|
14
5
|
"scripts": {
|
|
15
|
-
"
|
|
16
|
-
"dev": "tsup --watch",
|
|
17
|
-
"format": "biome format --write .",
|
|
18
|
-
"format:check": "biome format .",
|
|
19
|
-
"lint": "biome check .",
|
|
20
|
-
"lint:fix": "biome check --fix .",
|
|
21
|
-
"type-check": "tsc --noEmit",
|
|
22
|
-
"test": "vitest run",
|
|
23
|
-
"prepublishOnly": "npm run build"
|
|
24
|
-
},
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"commander": "^12.1.0",
|
|
27
|
-
"zod": "^3.24.0"
|
|
28
|
-
},
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"@biomejs/biome": "^2.2.4",
|
|
31
|
-
"@types/node": "^20.0.0",
|
|
32
|
-
"tsup": "^8.3.0",
|
|
33
|
-
"typescript": "^5.8.3",
|
|
34
|
-
"vitest": "^3.2.4"
|
|
35
|
-
},
|
|
36
|
-
"engines": {
|
|
37
|
-
"node": ">=18.0.0"
|
|
6
|
+
"postinstall": "node postinstall.js"
|
|
38
7
|
},
|
|
39
|
-
"keywords": [
|
|
40
|
-
"opensea",
|
|
41
|
-
"nft",
|
|
42
|
-
"cli",
|
|
43
|
-
"api",
|
|
44
|
-
"web3"
|
|
45
|
-
],
|
|
46
8
|
"license": "MIT",
|
|
47
9
|
"repository": {
|
|
48
10
|
"type": "git",
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
console.warn(`
|
|
2
|
+
╔═══════════════════════════════════════════════════════════════╗
|
|
3
|
+
║ ║
|
|
4
|
+
║ You installed "opensea-cli" — this package has moved. ║
|
|
5
|
+
║ ║
|
|
6
|
+
║ Install the correct package: ║
|
|
7
|
+
║ ║
|
|
8
|
+
║ npm install -g @opensea/cli ║
|
|
9
|
+
║ ║
|
|
10
|
+
╚═══════════════════════════════════════════════════════════════╝
|
|
11
|
+
`)
|
package/README.md
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
# opensea-cli
|
|
2
|
-
|
|
3
|
-
Query the OpenSea API from the command line or programmatically. Designed for both AI agents and developers.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install -g opensea-cli
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Or use without installing:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npx opensea-cli collections get mfers
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Authentication
|
|
18
|
-
|
|
19
|
-
Set your API key via environment variable or flag:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
export OPENSEA_API_KEY=your-api-key
|
|
23
|
-
opensea collections get mfers
|
|
24
|
-
|
|
25
|
-
# or pass inline
|
|
26
|
-
opensea --api-key your-api-key collections get mfers
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Get an API key at [docs.opensea.io](https://docs.opensea.io/reference/api-keys).
|
|
30
|
-
|
|
31
|
-
## CLI Usage
|
|
32
|
-
|
|
33
|
-
### Global Options
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
--api-key <key> OpenSea API key (or set OPENSEA_API_KEY env var)
|
|
37
|
-
--chain <chain> Default chain (default: ethereum)
|
|
38
|
-
--format <format> Output format: json or table (default: json)
|
|
39
|
-
--base-url <url> API base URL override
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### Collections
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
opensea collections get <slug>
|
|
46
|
-
opensea collections list [--chain <chain>] [--order-by <field>] [--limit <n>]
|
|
47
|
-
opensea collections stats <slug>
|
|
48
|
-
opensea collections traits <slug>
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### NFTs
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
opensea nfts get <chain> <contract> <token-id>
|
|
55
|
-
opensea nfts list-by-collection <slug> [--limit <n>]
|
|
56
|
-
opensea nfts list-by-contract <chain> <contract> [--limit <n>]
|
|
57
|
-
opensea nfts list-by-account <chain> <address> [--limit <n>]
|
|
58
|
-
opensea nfts refresh <chain> <contract> <token-id>
|
|
59
|
-
opensea nfts contract <chain> <address>
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Listings
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
opensea listings all <collection> [--limit <n>]
|
|
66
|
-
opensea listings best <collection> [--limit <n>]
|
|
67
|
-
opensea listings best-for-nft <collection> <token-id>
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Offers
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
opensea offers all <collection> [--limit <n>]
|
|
74
|
-
opensea offers collection <collection> [--limit <n>]
|
|
75
|
-
opensea offers best-for-nft <collection> <token-id>
|
|
76
|
-
opensea offers traits <collection> --type <type> --value <value>
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### Events
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
opensea events list [--event-type <type>] [--chain <chain>] [--limit <n>]
|
|
83
|
-
opensea events by-account <address> [--event-type <type>]
|
|
84
|
-
opensea events by-collection <slug> [--event-type <type>]
|
|
85
|
-
opensea events by-nft <chain> <contract> <token-id> [--event-type <type>]
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### Tokens
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
opensea tokens trending [--chains <chains>] [--limit <n>] [--cursor <cursor>]
|
|
92
|
-
opensea tokens top [--chains <chains>] [--limit <n>] [--cursor <cursor>]
|
|
93
|
-
opensea tokens get <chain> <address>
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### Swaps
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
opensea swaps quote --from-chain <chain> --from-address <address> --to-chain <chain> --to-address <address> --quantity <quantity> --address <address> [--slippage <slippage>] [--recipient <recipient>]
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Accounts
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
opensea accounts get <address>
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## Programmatic SDK
|
|
109
|
-
|
|
110
|
-
Use as a TypeScript/JavaScript library:
|
|
111
|
-
|
|
112
|
-
```typescript
|
|
113
|
-
import { OpenSeaCLI } from "opensea-cli"
|
|
114
|
-
|
|
115
|
-
const client = new OpenSeaCLI({ apiKey: process.env.OPENSEA_API_KEY })
|
|
116
|
-
|
|
117
|
-
const collection = await client.collections.get("mfers")
|
|
118
|
-
const stats = await client.collections.stats("mfers")
|
|
119
|
-
const nfts = await client.nfts.listByCollection("mfers", { limit: 5 })
|
|
120
|
-
const listings = await client.listings.best("mfers", { limit: 10 })
|
|
121
|
-
const events = await client.events.byCollection("mfers", { eventType: "sale" })
|
|
122
|
-
const account = await client.accounts.get("0x21130e908bba2d41b63fbca7caa131285b8724f8")
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## Output Formats
|
|
126
|
-
|
|
127
|
-
JSON (default) - structured output for agents and scripts:
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
opensea collections get mfers
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
Table - human-readable output:
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
opensea --format table collections list --limit 5
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
## Examples
|
|
140
|
-
|
|
141
|
-
Here are real-world examples using the [tiny dinos](https://opensea.io/collection/tiny-dinos-eth) and [mfers](https://opensea.io/collection/mfers) collections:
|
|
142
|
-
|
|
143
|
-
### Collections
|
|
144
|
-
|
|
145
|
-
```bash
|
|
146
|
-
# Get collection details
|
|
147
|
-
opensea collections get tiny-dinos-eth
|
|
148
|
-
|
|
149
|
-
# List collections with a limit
|
|
150
|
-
opensea collections list --limit 2
|
|
151
|
-
|
|
152
|
-
# Get collection stats (volume, floor price, etc.)
|
|
153
|
-
opensea collections stats tiny-dinos-eth
|
|
154
|
-
|
|
155
|
-
# Get collection traits
|
|
156
|
-
opensea collections traits tiny-dinos-eth
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### NFTs
|
|
160
|
-
|
|
161
|
-
```bash
|
|
162
|
-
# Get a specific NFT by chain/contract/token-id
|
|
163
|
-
opensea nfts get ethereum 0xd9b78a2f1dafc8bb9c60961790d2beefebee56f4 1
|
|
164
|
-
|
|
165
|
-
# List NFTs in a collection
|
|
166
|
-
opensea nfts list-by-collection tiny-dinos-eth --limit 2
|
|
167
|
-
|
|
168
|
-
# List NFTs by contract address
|
|
169
|
-
opensea nfts list-by-contract ethereum 0xd9b78a2f1dafc8bb9c60961790d2beefebee56f4 --limit 2
|
|
170
|
-
|
|
171
|
-
# List NFTs owned by an account
|
|
172
|
-
opensea nfts list-by-account ethereum 0x21130e908bba2d41b63fbca7caa131285b8724f8 --limit 2
|
|
173
|
-
|
|
174
|
-
# Get contract details
|
|
175
|
-
opensea nfts contract ethereum 0xd9b78a2f1dafc8bb9c60961790d2beefebee56f4
|
|
176
|
-
|
|
177
|
-
# Refresh NFT metadata
|
|
178
|
-
opensea nfts refresh ethereum 0xd9b78a2f1dafc8bb9c60961790d2beefebee56f4 1
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### Listings
|
|
182
|
-
|
|
183
|
-
```bash
|
|
184
|
-
# Get all listings for a collection
|
|
185
|
-
opensea listings all tiny-dinos-eth --limit 2
|
|
186
|
-
|
|
187
|
-
# Get best (cheapest) listings
|
|
188
|
-
opensea listings best tiny-dinos-eth --limit 2
|
|
189
|
-
|
|
190
|
-
# Get the best listing for a specific NFT
|
|
191
|
-
opensea listings best-for-nft mfers 3490
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### Offers
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
# Get all offers for a collection
|
|
198
|
-
opensea offers all tiny-dinos-eth --limit 2
|
|
199
|
-
|
|
200
|
-
# Get collection offers
|
|
201
|
-
opensea offers collection tiny-dinos-eth --limit 2
|
|
202
|
-
|
|
203
|
-
# Get best offer for a specific NFT
|
|
204
|
-
opensea offers best-for-nft tiny-dinos-eth 1
|
|
205
|
-
|
|
206
|
-
# Get trait offers (type and value are required)
|
|
207
|
-
opensea offers traits tiny-dinos-eth --type background --value blue --limit 2
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### Events
|
|
211
|
-
|
|
212
|
-
```bash
|
|
213
|
-
# List recent events across all collections
|
|
214
|
-
opensea events list --limit 2
|
|
215
|
-
|
|
216
|
-
# Get events for a collection
|
|
217
|
-
opensea events by-collection tiny-dinos-eth --limit 2
|
|
218
|
-
|
|
219
|
-
# Get events for a specific NFT
|
|
220
|
-
opensea events by-nft ethereum 0xd9b78a2f1dafc8bb9c60961790d2beefebee56f4 1 --limit 2
|
|
221
|
-
|
|
222
|
-
# Get events for an account
|
|
223
|
-
opensea events by-account 0x21130e908bba2d41b63fbca7caa131285b8724f8 --limit 2
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
### Tokens
|
|
227
|
-
|
|
228
|
-
```bash
|
|
229
|
-
# Get trending tokens
|
|
230
|
-
opensea tokens trending --limit 2
|
|
231
|
-
|
|
232
|
-
# Get trending tokens on a specific chain
|
|
233
|
-
opensea tokens trending --chains base --limit 2
|
|
234
|
-
|
|
235
|
-
# Get top tokens by 24-hour volume
|
|
236
|
-
opensea tokens top --limit 2
|
|
237
|
-
|
|
238
|
-
# Get top tokens on a specific chain
|
|
239
|
-
opensea tokens top --chains base --limit 2
|
|
240
|
-
|
|
241
|
-
# Get details for a specific token (DebtReliefBot on Base)
|
|
242
|
-
opensea tokens get base 0x3ec2156d4c0a9cbdab4a016633b7bcf6a8d68ea2
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
### Accounts
|
|
246
|
-
|
|
247
|
-
```bash
|
|
248
|
-
# Get account details
|
|
249
|
-
opensea accounts get 0x21130e908bba2d41b63fbca7caa131285b8724f8
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
## Exit Codes
|
|
253
|
-
|
|
254
|
-
- `0` - Success
|
|
255
|
-
- `1` - API error
|
|
256
|
-
- `2` - Authentication error
|
|
257
|
-
|
|
258
|
-
## Requirements
|
|
259
|
-
|
|
260
|
-
- Node.js >= 18.0.0
|
|
261
|
-
- OpenSea API key ([get one here](https://docs.opensea.io/reference/api-keys))
|