Skip to content

Commit acc7a44

Browse files
authored
Merge pull request #15 from ProjectOpenSea/devin/1772002473-token-cli-readme-examples
docs: add token and swap CLI examples to README
2 parents ccbf6f4 + 2f53905 commit acc7a44

2 files changed

Lines changed: 49 additions & 5 deletions

File tree

README.md

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,20 @@ opensea events by-collection <slug> [--event-type <type>]
8585
opensea events by-nft <chain> <contract> <token-id> [--event-type <type>]
8686
```
8787

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+
88102
### Accounts
89103

90104
```bash
@@ -105,7 +119,7 @@ const stats = await client.collections.stats("mfers")
105119
const nfts = await client.nfts.listByCollection("mfers", { limit: 5 })
106120
const listings = await client.listings.best("mfers", { limit: 10 })
107121
const events = await client.events.byCollection("mfers", { eventType: "sale" })
108-
const account = await client.accounts.get("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045")
122+
const account = await client.accounts.get("0x21130e908bba2d41b63fbca7caa131285b8724f8")
109123
```
110124

111125
## Output Formats
@@ -155,7 +169,7 @@ opensea nfts list-by-collection tiny-dinos-eth --limit 2
155169
opensea nfts list-by-contract ethereum 0xd9b78a2f1dafc8bb9c60961790d2beefebee56f4 --limit 2
156170

157171
# List NFTs owned by an account
158-
opensea nfts list-by-account ethereum 0xde7fce3a1cba4a705f299ce41d163017f165d666 --limit 2
172+
opensea nfts list-by-account ethereum 0x21130e908bba2d41b63fbca7caa131285b8724f8 --limit 2
159173

160174
# Get contract details
161175
opensea nfts contract ethereum 0xd9b78a2f1dafc8bb9c60961790d2beefebee56f4
@@ -206,14 +220,44 @@ opensea events by-collection tiny-dinos-eth --limit 2
206220
opensea events by-nft ethereum 0xd9b78a2f1dafc8bb9c60961790d2beefebee56f4 1 --limit 2
207221

208222
# Get events for an account
209-
opensea events by-account 0xde7fce3a1cba4a705f299ce41d163017f165d666 --limit 2
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+
### Swaps
246+
247+
```bash
248+
# Get a swap quote for USDC to DRB on Base
249+
opensea swaps quote \
250+
--from-chain base --from-address 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 \
251+
--to-chain base --to-address 0x3ec2156d4c0a9cbdab4a016633b7bcf6a8d68ea2 \
252+
--quantity 1000000 \
253+
--address 0x21130e908bba2d41b63fbca7caa131285b8724f8
210254
```
211255

212256
### Accounts
213257

214258
```bash
215259
# Get account details
216-
opensea accounts get 0xde7fce3a1cba4a705f299ce41d163017f165d666
260+
opensea accounts get 0x21130e908bba2d41b63fbca7caa131285b8724f8
217261
```
218262

219263
## Exit Codes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opensea-cli",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"type": "module",
55
"description": "OpenSea CLI - Query the OpenSea API from the command line or programmatically",
66
"main": "dist/index.js",

0 commit comments

Comments
 (0)