Skip to content

Commit 364c2e4

Browse files
committed
Release v1.16.0
Origin-SHA: ce934c6cff606d354494c7ba1ecf95ac58ff3b17
1 parent 45ef58c commit 364c2e4

14 files changed

Lines changed: 207 additions & 17 deletions

File tree

CHANGELOG.md

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

3+
## 1.16.0
4+
5+
### Minor Changes
6+
7+
- cba26dd: Add typed SDK and CLI support for building cross-chain drop mint transactions and polling the returned receipt request.
8+
9+
### Patch Changes
10+
11+
- Updated dependencies [cba26dd]
12+
- @opensea/api-types@0.8.4
13+
- @opensea/sdk@11.6.0
14+
315
## 1.15.1
416

517
### Patch Changes

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ opensea --format table collections stats mfers
102102
| `nfts` | Get, list, refresh metadata, and contract details for NFTs |
103103
| `listings` | Get all, best, or best-for-nft listings |
104104
| `offers` | Get all, collection, best-for-nft, and trait offers |
105+
| `drops` | Query drops and build same-chain or cross-chain mint transactions |
106+
| `transactions` | Poll transaction and cross-chain receipt status |
105107
| `events` | List marketplace events (sales, transfers, mints, etc.) |
106108
| `search` | Search collections, NFTs, tokens, and accounts |
107109
| `tokens` | Get trending tokens, top tokens, and token details |

biome.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"**/*.ts",
1111
"**/*.js",
1212
"**/*.json",
13+
"!packages/tool-registry/lib",
1314
"!**/.claude",
1415
"!**/typechain",
1516
"!lib",

docs/cli-reference.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,25 @@ opensea offers best-for-nft <collection> <token-id>
8181
opensea offers traits <collection> --type <type> --value <value> [--limit <n>] [--next <cursor>]
8282
```
8383

84+
## Drops
85+
86+
```bash
87+
opensea drops list [--type <type>] [--chains <chains>] [--limit <n>] [--next <cursor>]
88+
opensea drops get <slug>
89+
opensea drops mint <slug> --minter <address> [--quantity <n>]
90+
opensea drops cross-chain-mint <slug> --payer <address> --minter <address> --payment-chain <chain> --payment-token <address> [--quantity <n>]
91+
```
92+
93+
Cross-chain minting returns ordered transactions plus `receipt_request`.
94+
Submit the transactions in order, save `receipt_request` unchanged to a JSON
95+
file, and poll it with the transactions command until the status is terminal.
96+
97+
## Transactions
98+
99+
```bash
100+
opensea transactions receipt --request <receipt-request.json>
101+
```
102+
84103
## Events
85104

86105
```bash

docs/examples.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,23 @@ opensea offers best-for-nft tiny-dinos-eth 1
6969
opensea offers traits tiny-dinos-eth --type background --value blue --limit 2
7070
```
7171

72+
## Cross-chain minting
73+
74+
```bash
75+
# Build ordered transactions that pay with native currency on Base and mint
76+
# the drop NFT on its destination chain.
77+
opensea drops cross-chain-mint pyro-on-ape \
78+
--payer 0x1111111111111111111111111111111111111111 \
79+
--minter 0x1111111111111111111111111111111111111111 \
80+
--payment-chain base \
81+
--payment-token 0x0000000000000000000000000000000000000000 \
82+
--quantity 1
83+
84+
# After submitting every returned transaction, copy receipt_request from the
85+
# response into receipt-request.json and poll until SUCCESS or FAILED.
86+
opensea transactions receipt --request receipt-request.json
87+
```
88+
7289
## Events
7390

7491
```bash

docs/sdk.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,23 @@ const { offers, next } = await client.offers.traits("mfers", {
8686
})
8787
```
8888

89+
## Drops and cross-chain minting
90+
91+
```typescript
92+
const mint = await client.drops.crossChainMint("pyro-on-ape", {
93+
payer: "0x1111111111111111111111111111111111111111",
94+
minter: "0x1111111111111111111111111111111111111111",
95+
quantity: 1,
96+
payment: {
97+
chain: "base",
98+
token_address: "0x0000000000000000000000000000000000000000",
99+
},
100+
})
101+
102+
// Submit mint.transactions in order, then poll the exact returned request.
103+
const receipt = await client.transactions.receipt(mint.receipt_request)
104+
```
105+
89106
## Events
90107

91108
```typescript

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.1",
3+
"version": "1.16.0",
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.3",
27-
"@opensea/sdk": "^11.5.1",
26+
"@opensea/api-types": "^0.8.4",
27+
"@opensea/sdk": "^11.6.0",
2828
"@opensea/wallet-adapters": "^0.3.3",
2929
"commander": "^14.0.3",
3030
"zod": "^4.3.6"

src/commands/drops.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import {
99
} from "../parse.js"
1010
import type {
1111
Chain,
12+
CrossChainDropMintRequest,
13+
CrossChainDropMintResponse,
1214
DropDeployRequest,
1315
DropDeployResponse,
1416
DropEligibilityResponse,
@@ -107,6 +109,47 @@ export function dropsCommand(
107109
},
108110
)
109111

112+
cmd
113+
.command("cross-chain-mint")
114+
.description("Build transactions to pay on one chain and mint on another")
115+
.argument("<slug>", "Collection slug")
116+
.requiredOption("--payer <address>", "Wallet that signs and pays")
117+
.requiredOption("--minter <address>", "Wallet that receives the NFT")
118+
.requiredOption("--payment-chain <chain>", "Chain used for payment")
119+
.requiredOption(
120+
"--payment-token <address>",
121+
"Payment token contract or the null address for native currency",
122+
)
123+
.option("--quantity <n>", "Number of tokens to mint", "1")
124+
.action(
125+
async (
126+
slug: string,
127+
options: {
128+
payer: string
129+
minter: string
130+
paymentChain: string
131+
paymentToken: string
132+
quantity: string
133+
},
134+
) => {
135+
const client = getClient()
136+
const request: CrossChainDropMintRequest = {
137+
payer: options.payer,
138+
minter: options.minter,
139+
quantity: parseIntOption(options.quantity, "--quantity"),
140+
payment: {
141+
chain: options.paymentChain,
142+
token_address: options.paymentToken,
143+
},
144+
}
145+
const result = await client.post<CrossChainDropMintResponse>(
146+
`/api/v2/drops/${slug}/cross_chain_mint`,
147+
request,
148+
)
149+
console.log(formatOutput(result, getFormat()))
150+
},
151+
)
152+
110153
cmd
111154
.command("deploy")
112155
.description("Build a deploy-contract transaction for a new drop")

src/commands/transactions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function transactionsCommand(
2020
.command("receipt")
2121
.description(
2222
"Fetch transaction status. Works for listing fulfillments, " +
23-
"cross-chain buys, sweeps, offer fulfillments, and token swaps.",
23+
"cross-chain buys and mints, sweeps, offer fulfillments, and token swaps.",
2424
)
2525
.requiredOption(
2626
"--request <file>",

0 commit comments

Comments
 (0)