Skip to content

Commit a2eabfc

Browse files
ryanioclaudedevin-ai-integration[bot]
committed
Release v2.11.2
Origin-SHA: 6e70c083664cd32ba233423dda3c02071b7fdffb ### Patch Changes - e83546e: Docs: the README search examples use `opensea search <query> --types collection` and `client.search.query(...)`, the syntax the CLI and SDK accept. - 6b30bd0: `opensea drops deploy` validates `--drop-type` and `--token-type` against the values the API accepts before sending a request, and `--send` refuses a contract-creation deploy (`erc721_standard`, which has no `to` address) with a clear message instead of sending it. - Updated dependencies [e83546e] - Updated dependencies [e83546e] - Updated dependencies [86b3bcd] - Updated dependencies [6b30bd0] - @opensea/api-types@0.16.0 - @opensea/sdk@12.11.3 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 71faa81 commit a2eabfc

8 files changed

Lines changed: 108 additions & 31 deletions

File tree

‎CHANGELOG.md‎

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

3+
## 2.11.2
4+
5+
### Patch Changes
6+
7+
- e83546e: Docs: the README search examples use `opensea search <query> --types collection` and `client.search.query(...)`, the syntax the CLI and SDK accept.
8+
- 6b30bd0: `opensea drops deploy` validates `--drop-type` and `--token-type` against the values the API accepts before sending a request, and `--send` refuses a contract-creation deploy (`erc721_standard`, which has no `to` address) with a clear message instead of sending it.
9+
- Updated dependencies [e83546e]
10+
- Updated dependencies [e83546e]
11+
- Updated dependencies [86b3bcd]
12+
- Updated dependencies [6b30bd0]
13+
- @opensea/api-types@0.16.0
14+
- @opensea/sdk@12.11.3
15+
316
## 2.11.1
417

518
### Patch Changes

‎README.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ opensea nfts list-by-collection mfers --limit 5
9696
opensea listings best mfers --limit 5
9797

9898
# Search across OpenSea
99-
opensea search collections "cool cats"
99+
opensea search "cool cats" --types collection
100100

101101
# Get trending tokens
102102
opensea tokens trending --limit 5
@@ -160,7 +160,10 @@ const activity = await client.tokens.activityStats(
160160
"0x4200000000000000000000000000000000000006",
161161
{ windows: ["1h", "24h"] },
162162
)
163-
const results = await client.search.collections("mfers", { limit: 5 })
163+
const results = await client.search.query("mfers", {
164+
assetTypes: ["collection"],
165+
limit: 5,
166+
})
164167
const declared = await client.agent.declare()
165168
const { relationships } = await client.agent.list()
166169

‎docs/cli-reference.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ opensea drops deploy-receipt <chain> <tx-hash> [--wait] [--interval <seconds>] [
243243
`deploy` prints a ready-to-sign deploy transaction. `--chain` is required and
244244
never defaults to `ethereum`. With `--send` it signs and sends the transaction
245245
with the configured EVM wallet, which must be the `--sender` address, and
246-
prints the hash and chain. Pass both to `deploy-receipt` next.
246+
prints the hash and chain. Pass both to `deploy-receipt` next. `--send` cannot
247+
send an `erc721_standard` deploy, a contract-creation transaction with a null
248+
`to`; print it without `--send` and broadcast it from your own wallet.
247249

248250
`deploy-receipt --wait` polls every `--interval` seconds (default 5) until the
249251
receipt has a `collection_slug` or its status is `failed`, for at most

‎package-lock.json‎

Lines changed: 22 additions & 22 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": "2.11.1",
3+
"version": "2.11.2",
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.15.1",
27-
"@opensea/sdk": "^12.11.2",
26+
"@opensea/api-types": "^0.16.0",
27+
"@opensea/sdk": "^12.11.3",
2828
"@opensea/wallet-adapters": "^1.2.1",
2929
"commander": "^14.0.3",
3030
"zod": "^4.3.6"

‎src/commands/drops.ts‎

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,29 @@ async function readListedFile(file: ListedMediaFile): Promise<Buffer> {
168168
}
169169
}
170170

171+
const DROP_TYPES = [
172+
"seadrop_v1_erc721",
173+
"seadrop_v2_erc1155_self_mint",
174+
] as const satisfies readonly DropDeployRequest["drop_type"][]
175+
const TOKEN_TYPES = [
176+
"erc721_clone",
177+
"erc721_standard",
178+
"erc1155_clone",
179+
] as const satisfies readonly DropDeployRequest["token_type"][]
180+
181+
function parseChoice<T extends string>(
182+
value: string,
183+
flag: string,
184+
choices: readonly T[],
185+
): T {
186+
if (!choices.includes(value as T)) {
187+
throw new Error(
188+
`Invalid value for ${flag}: "${value}". Expected one of: ${choices.join(", ")}.`,
189+
)
190+
}
191+
return value as T
192+
}
193+
171194
// Validated before any request, so a bad flag never starts a workflow or a
172195
// poll.
173196
function parseWaitOptions(options: { interval: string; waitTimeout: string }): {
@@ -473,8 +496,12 @@ export function dropsCommand(
473496
chain,
474497
contract_name: options.name,
475498
contract_symbol: options.symbol,
476-
drop_type: options.dropType,
477-
token_type: options.tokenType,
499+
drop_type: parseChoice(options.dropType, "--drop-type", DROP_TYPES),
500+
token_type: parseChoice(
501+
options.tokenType,
502+
"--token-type",
503+
TOKEN_TYPES,
504+
),
478505
sender: options.sender,
479506
}
480507
if (!options.send) {

‎src/sdk.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,13 @@ export class DropsAPI {
606606
`Wallet ${address} is not the deploy sender ${sender}. The deploy was built for ${sender}; send it from that wallet, or request a new deploy with the wallet's address as sender.`,
607607
)
608608
}
609-
return sendDropTransaction(evmWallet, tx, callbacks)
609+
const { to } = tx
610+
if (to === null) {
611+
throw new Error(
612+
"This deploy is a contract-creation transaction with no `to` address, which the wallet adapters cannot send yet. Run without --send and broadcast it with no `to` from your own wallet, or deploy with token_type erc721_clone.",
613+
)
614+
}
615+
return sendDropTransaction(evmWallet, { ...tx, to }, callbacks)
610616
}
611617

612618
/**

‎test/commands/drops.test.ts‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,32 @@ describe("dropsCommand", () => {
622622
expect(wallet.sendTransaction).not.toHaveBeenCalled()
623623
})
624624

625+
it("deploy --send refuses a contract-creation transaction with no to", async () => {
626+
vi.spyOn(console, "error").mockImplementation(() => {})
627+
ctx.mockClient.post.mockResolvedValue({ ...deployTx, to: null })
628+
const wallet = evmWallet(OWNER)
629+
walletMock.createWalletFromEnv.mockReturnValue(wallet)
630+
631+
const cmd = dropsCommand(ctx.getClient, ctx.getFormat)
632+
await expect(
633+
cmd.parseAsync([...deployArgs, "--send"], { from: "user" }),
634+
).rejects.toThrow("contract-creation transaction with no `to` address")
635+
636+
expect(wallet.sendTransaction).not.toHaveBeenCalled()
637+
})
638+
639+
it("deploy rejects an unknown --drop-type before any request", async () => {
640+
const args = [...deployArgs]
641+
args[args.indexOf("--drop-type") + 1] = "seadrop_v9"
642+
643+
const cmd = dropsCommand(ctx.getClient, ctx.getFormat)
644+
await expect(cmd.parseAsync(args, { from: "user" })).rejects.toThrow(
645+
'Invalid value for --drop-type: "seadrop_v9"',
646+
)
647+
648+
expect(ctx.mockClient.post).not.toHaveBeenCalled()
649+
})
650+
625651
it("deploy --send rejects a Solana wallet before building the transaction", async () => {
626652
const stderr = vi.spyOn(console, "error").mockImplementation(() => {})
627653
vi.spyOn(process, "exit").mockImplementation(() => {

0 commit comments

Comments
 (0)