Skip to content

Commit 45ef58c

Browse files
committed
Release v1.15.1
Origin-SHA: e0b3752f15ed091ffbccb8c51a6174c211d8a14d
1 parent 62f09a8 commit 45ef58c

21 files changed

Lines changed: 1345 additions & 18 deletions

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# @opensea/cli
22

3+
## 1.15.1
4+
5+
### Patch Changes
6+
7+
- 99a5a9e: Add CLI commands for the remaining public scoped-token endpoints: social follow/watch and relationship/followers/following, watchlist add/remove and token/perpetual watchlist reads, order cancellation, wallet unlink, profile writes (settings, username, image upload, NFT PFP set/clear, shelves), drop editing (edits, allowlist, prereveal/self-mint items, item media), and collection editing (modify, metadata, visibility, image upload).
8+
- Updated dependencies [8df1f43]
9+
- Updated dependencies [14fcba5]
10+
- @opensea/sdk@11.5.1
11+
312
## 1.15.0
413

514
### Minor Changes

package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opensea/cli",
3-
"version": "1.15.0",
3+
"version": "1.15.1",
44
"type": "module",
55
"description": "OpenSea CLI - Query the OpenSea API from the command line or programmatically",
66
"main": "dist/index.js",
@@ -23,8 +23,8 @@
2323
"prepublishOnly": "npm run build"
2424
},
2525
"dependencies": {
26-
"@opensea/api-types": "^0.8.2",
27-
"@opensea/sdk": "^11.5.0",
26+
"@opensea/api-types": "^0.8.3",
27+
"@opensea/sdk": "^11.5.1",
2828
"@opensea/wallet-adapters": "^0.3.3",
2929
"commander": "^14.0.3",
3030
"zod": "^4.3.6"

src/cli.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import {
1515
loginCommand,
1616
nftsCommand,
1717
offersCommand,
18+
ordersCommand,
19+
profileCommand,
1820
searchCommand,
1921
swapsCommand,
2022
tokenGroupsCommand,
@@ -144,15 +146,18 @@ program.addCommand(dropsCommand(getClient, getFormat))
144146
program.addCommand(nftsCommand(getClient, getFormat))
145147
program.addCommand(listingsCommand(getClient, getFormat))
146148
program.addCommand(offersCommand(getClient, getFormat))
149+
program.addCommand(ordersCommand(getClient, getFormat))
147150
program.addCommand(eventsCommand(getClient, getFormat))
148151
program.addCommand(accountsCommand(getClient, getFormat))
152+
program.addCommand(profileCommand(getClient, getFormat))
149153
program.addCommand(tokensCommand(getClient, getFormat))
150154
program.addCommand(tokenGroupsCommand(getClient, getFormat))
151155
program.addCommand(
152156
authCommand(
153157
() => program.opts<{ baseUrl?: string }>().baseUrl,
154158
getFormat,
155159
() => program.opts<{ authBaseUrl?: string }>().authBaseUrl,
160+
getClient,
156161
),
157162
)
158163
program.addCommand(

src/commands/accounts.ts

Lines changed: 192 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
import { Command } from "commander"
22
import type { OpenSeaClient } from "../client.js"
33
import type { OutputFormat } from "../output.js"
4-
import { outputGet } from "../output.js"
5-
import { addPaginationOptions, parseIntOption } from "../parse.js"
6-
import type { TokenBalanceSortBy } from "../types/index.js"
4+
import { formatOutput, outputGet } from "../output.js"
5+
import {
6+
addPaginationOptions,
7+
parseIntOption,
8+
readJsonBodyOption,
9+
} from "../parse.js"
10+
import type {
11+
FavoriteResponse,
12+
TokenBalanceSortBy,
13+
WatchlistRequest,
14+
} from "../types/index.js"
715

816
export function accountsCommand(
917
getClient: () => OpenSeaClient,
@@ -373,5 +381,186 @@ export function accountsCommand(
373381
},
374382
)
375383

384+
cmd
385+
.command("relationship")
386+
.description(
387+
"Get the authenticated wallet's follow/watch relationship with an account (wallet auth required)",
388+
)
389+
.argument("<address_or_username>", "Wallet address or OpenSea username")
390+
.action(async (addressOrUsername: string) => {
391+
const client = getClient()
392+
await outputGet(
393+
client,
394+
getFormat(),
395+
`/api/v2/accounts/${addressOrUsername}/relationship`,
396+
)
397+
})
398+
399+
addPaginationOptions(
400+
cmd
401+
.command("followers")
402+
.description("List an account's followers")
403+
.argument("<address_or_username>", "Wallet address or OpenSea username"),
404+
).action(
405+
async (
406+
addressOrUsername: string,
407+
options: { limit: string; next?: string },
408+
) => {
409+
const client = getClient()
410+
await outputGet(
411+
client,
412+
getFormat(),
413+
`/api/v2/accounts/${addressOrUsername}/followers`,
414+
{
415+
limit: parseIntOption(options.limit, "--limit"),
416+
cursor: options.next,
417+
},
418+
)
419+
},
420+
)
421+
422+
addPaginationOptions(
423+
cmd
424+
.command("following")
425+
.description("List the accounts an account is following")
426+
.argument("<address_or_username>", "Wallet address or OpenSea username"),
427+
).action(
428+
async (
429+
addressOrUsername: string,
430+
options: { limit: string; next?: string },
431+
) => {
432+
const client = getClient()
433+
await outputGet(
434+
client,
435+
getFormat(),
436+
`/api/v2/accounts/${addressOrUsername}/following`,
437+
{
438+
limit: parseIntOption(options.limit, "--limit"),
439+
cursor: options.next,
440+
},
441+
)
442+
},
443+
)
444+
445+
cmd
446+
.command("follow")
447+
.description("Follow an account as the authenticated wallet")
448+
.argument("<address_or_username>", "Wallet address or OpenSea username")
449+
.action(async (addressOrUsername: string) => {
450+
const client = getClient()
451+
const result = await client.post(
452+
`/api/v2/accounts/${addressOrUsername}/follow`,
453+
)
454+
console.log(formatOutput(result, getFormat()))
455+
})
456+
457+
cmd
458+
.command("unfollow")
459+
.description("Unfollow an account as the authenticated wallet")
460+
.argument("<address_or_username>", "Wallet address or OpenSea username")
461+
.action(async (addressOrUsername: string) => {
462+
const client = getClient()
463+
const result = await client.delete(
464+
`/api/v2/accounts/${addressOrUsername}/follow`,
465+
)
466+
console.log(formatOutput(result, getFormat()))
467+
})
468+
469+
cmd
470+
.command("watch")
471+
.description("Watch an account as the authenticated wallet")
472+
.argument("<address_or_username>", "Wallet address or OpenSea username")
473+
.action(async (addressOrUsername: string) => {
474+
const client = getClient()
475+
const result = await client.post(
476+
`/api/v2/accounts/${addressOrUsername}/watch`,
477+
)
478+
console.log(formatOutput(result, getFormat()))
479+
})
480+
481+
cmd
482+
.command("unwatch")
483+
.description("Unwatch an account as the authenticated wallet")
484+
.argument("<address_or_username>", "Wallet address or OpenSea username")
485+
.action(async (addressOrUsername: string) => {
486+
const client = getClient()
487+
const result = await client.delete(
488+
`/api/v2/accounts/${addressOrUsername}/watch`,
489+
)
490+
console.log(formatOutput(result, getFormat()))
491+
})
492+
493+
cmd
494+
.command("token-watchlist")
495+
.description(
496+
"Get the authenticated wallet's token watchlist (wallet auth required)",
497+
)
498+
.argument("<address>", "Wallet address")
499+
.action(async (address: string) => {
500+
const client = getClient()
501+
await outputGet(
502+
client,
503+
getFormat(),
504+
`/api/v2/account/${address}/token_watchlist`,
505+
)
506+
})
507+
508+
cmd
509+
.command("perpetual-watchlist")
510+
.description(
511+
"Get the authenticated wallet's perpetual watchlist (wallet auth required)",
512+
)
513+
.argument("<address>", "Wallet address")
514+
.action(async (address: string) => {
515+
const client = getClient()
516+
await outputGet(
517+
client,
518+
getFormat(),
519+
`/api/v2/account/${address}/perpetual_watchlist`,
520+
)
521+
})
522+
523+
cmd
524+
.command("watchlist-add")
525+
.description(
526+
"Add an item, collection, or token to the authenticated wallet's watchlist",
527+
)
528+
.requiredOption(
529+
"--body <path>",
530+
"Path to JSON file with the WatchlistRequest body",
531+
)
532+
.action(async (options: { body: string }) => {
533+
const client = getClient()
534+
const request = readJsonBodyOption<WatchlistRequest>(
535+
options.body,
536+
"--body",
537+
)
538+
const result = await client.post<FavoriteResponse>(
539+
"/api/v2/watchlist",
540+
request,
541+
)
542+
console.log(formatOutput(result, getFormat()))
543+
})
544+
545+
cmd
546+
.command("watchlist-remove")
547+
.description("Remove an entry from the authenticated wallet's watchlist")
548+
.requiredOption(
549+
"--body <path>",
550+
"Path to JSON file with the WatchlistRequest body",
551+
)
552+
.action(async (options: { body: string }) => {
553+
const client = getClient()
554+
const request = readJsonBodyOption<WatchlistRequest>(
555+
options.body,
556+
"--body",
557+
)
558+
const result = await client.delete<FavoriteResponse>(
559+
"/api/v2/watchlist",
560+
request,
561+
)
562+
console.log(formatOutput(result, getFormat()))
563+
})
564+
376565
return cmd
377566
}

src/commands/auth.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ import {
2626
removeToken,
2727
saveToken,
2828
} from "../auth/store.js"
29+
import type { OpenSeaClient } from "../client.js"
2930
import type { OutputFormat } from "../output.js"
3031
import { formatOutput } from "../output.js"
32+
import type { WalletUnlinkResponse } from "../types/index.js"
3133

3234
const DEFAULT_BASE_URL = "https://api.opensea.io"
3335

@@ -41,6 +43,7 @@ export function authCommand(
4143
getBaseUrl: () => string | undefined,
4244
getFormat: () => OutputFormat,
4345
getAuthBaseUrl?: () => string | undefined,
46+
getClient?: () => OpenSeaClient,
4447
): Command {
4548
const cmd = new Command("auth").description(
4649
"Authentication and token management",
@@ -251,6 +254,23 @@ export function authCommand(
251254
},
252255
)
253256

257+
cmd
258+
.command("unlink-wallet")
259+
.description(
260+
"Unlink a wallet from the authenticated account (requires write:wallets)",
261+
)
262+
.argument("<wallet>", "Wallet address to unlink")
263+
.action(async (wallet: string) => {
264+
if (!getClient) {
265+
throw new Error("unlink-wallet is not available in this context")
266+
}
267+
const client = getClient()
268+
const result = await client.delete<WalletUnlinkResponse>(
269+
`/api/v2/accounts/wallets/${wallet}`,
270+
)
271+
console.log(formatOutput(result, getFormat()))
272+
})
273+
254274
// --- status ---
255275
cmd
256276
.command("status")

0 commit comments

Comments
 (0)