Skip to content

Commit 4062ebf

Browse files
committed
Release v10.3.1
1 parent 1d929b1 commit 4062ebf

7 files changed

Lines changed: 56 additions & 72 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ When reviewing changes to this package, verify:
4343

4444
2. **Dual provider support**: Both `OpenSeaSDK` (ethers) and `OpenSeaViemSDK` (viem) must work. Changes to `BaseOpenSeaSDK` affect both. If adding provider-specific logic, ensure both adapters in `src/provider/` are updated.
4545

46-
3. **`@opensea/api-types` dependency**: The SDK imports types from the workspace `@opensea/api-types` package. If the OpenAPI spec changes, rebuild api-types first (`pnpm --filter @opensea/api-types run build`) before testing the SDK.
46+
3. **`@opensea/api-types` dependency**: The SDK imports types from the workspace `@opensea/api-types` package. If the OpenAPI spec changes, rebuild api-types first (`pnpm --filter @opensea/api-types run build`) before testing the SDK. **Never hand-roll API request/response types in `src/api/types.ts`** — always import from `@opensea/api-types` (or re-export through `src/api/types.ts`) using the canonical OpenAPI schema names. The `pnpm check-api-paths` CI guardrail will fail the build if `src/api/apiPaths.ts` references a URL that isn't in `packages/api-types/opensea-api.json`. See the top-level [AGENTS.md → "Adding a new OpenSea API endpoint"](../../AGENTS.md#adding-a-new-opensea-api-endpoint-to-the-sdk-or-cli) for the full flow.
4747

4848
4. **Seaport integration**: Order creation and fulfillment flows use `@opensea/seaport-js`. Changes to order parameters, consideration items, or fulfillment logic must be tested against the Seaport contract behavior.
4949

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# @opensea/sdk
22

3+
## 10.3.1
4+
5+
### Patch Changes
6+
7+
- 961f2c5: fix(api): consume cross-chain fulfillment types from `@opensea/api-types`
8+
9+
The cross-chain fulfillment types added in the previous release were hand-rolled in `packages/sdk/src/api/types.ts` and `packages/cli/src/types/api.ts` rather than generated from the OpenAPI spec. This release pulls them from `@opensea/api-types` (the source of truth) so future spec changes flow through automatically.
10+
11+
**`@opensea/api-types`**: Adds named exports for `CrossChainFulfillmentRequest`, `CrossChainFulfillmentResponse`, `CrossChainPaymentToken`, `FulfillerObject`, and `ListingObject` schemas (regenerated from the production OpenAPI spec).
12+
13+
**`@opensea/sdk`** _(type rename — minimal-impact since the prior release shipped <1 day ago)_:
14+
15+
- `CrossChainListing``ListingObject`
16+
- `CrossChainFulfillmentDataRequest``CrossChainFulfillmentRequest`
17+
- `CrossChainFulfillmentDataResponse``CrossChainFulfillmentResponse`
18+
- `CrossChainTransaction``SwapTransactionResponse`
19+
20+
The runtime call signature on `BaseOpenSeaSDK.getCrossChainFulfillmentData()` is unchanged.
21+
22+
**`@opensea/cli`** _(type rename — same minimal impact)_:
23+
24+
- `CrossChainFulfillmentTransaction``SwapTransactionResponse`
25+
- `CrossChainFulfillmentDataResponse``CrossChainFulfillmentResponse`
26+
27+
Adds a new blocking CI check (`pnpm check-api-paths`) that fails when an `/api/v2/...` URL referenced in SDK or CLI source is not present in `packages/api-types/opensea-api.json`. AGENTS docs updated to make the api-types-first flow explicit for new endpoints.
28+
29+
- Updated dependencies [961f2c5]
30+
- @opensea/api-types@0.2.3
31+
332
## 10.3.0
433

534
### Minor Changes

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opensea/sdk",
3-
"version": "10.3.0",
3+
"version": "10.3.1",
44
"description": "TypeScript SDK for the OpenSea marketplace helps developers build new experiences using NFTs, tokens, and our marketplace data",
55
"license": "MIT",
66
"author": "OpenSea Developers",
@@ -45,7 +45,7 @@
4545
"types": "lib/index.d.ts",
4646
"dependencies": {
4747
"@noble/hashes": "^2.0.1",
48-
"@opensea/api-types": "^0.2.2",
48+
"@opensea/api-types": "^0.2.3",
4949
"@opensea/seaport-js": "^4.1.1",
5050
"ethers": "^6.16.0"
5151
},

src/api/api.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ import {
3535
type CancelOrderResponse,
3636
type CollectionOffer,
3737
CollectionOrderByOption,
38-
type CrossChainFulfillmentDataRequest,
39-
type CrossChainFulfillmentDataResponse,
38+
type CrossChainFulfillmentRequest,
39+
type CrossChainFulfillmentResponse,
4040
type DropMintRequest,
4141
type DropMintResponse,
4242
type GetAccountTokensArgs,
@@ -326,11 +326,11 @@ export class OpenSeaAPI {
326326
* Supports same-chain, cross-token, and cross-chain purchases (up to 50 listings).
327327
* All listings must be EVM (Seaport orders). Payment can be from any chain (EVM or SVM).
328328
* @param request The cross-chain fulfillment request containing listings, fulfiller, payment, and optional recipient
329-
* @returns The {@link CrossChainFulfillmentDataResponse} with ordered transactions to sign and submit
329+
* @returns The {@link CrossChainFulfillmentResponse} with ordered transactions to sign and submit
330330
*/
331331
public async getCrossChainFulfillmentData(
332-
request: CrossChainFulfillmentDataRequest,
333-
): Promise<CrossChainFulfillmentDataResponse> {
332+
request: CrossChainFulfillmentRequest,
333+
): Promise<CrossChainFulfillmentResponse> {
334334
return this.listingsAPI.getCrossChainFulfillmentData(request)
335335
}
336336

src/api/listings.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import {
99
} from "./apiPaths"
1010
import type { Fetcher } from "./fetcher"
1111
import {
12-
type CrossChainFulfillmentDataRequest,
13-
type CrossChainFulfillmentDataResponse,
12+
type CrossChainFulfillmentRequest,
13+
type CrossChainFulfillmentResponse,
1414
encodeTraitsParam,
1515
type GetBestListingResponse,
1616
type GetListingsResponse,
@@ -137,9 +137,9 @@ export class ListingsAPI {
137137
* @param request The cross-chain fulfillment request
138138
*/
139139
async getCrossChainFulfillmentData(
140-
request: CrossChainFulfillmentDataRequest,
141-
): Promise<CrossChainFulfillmentDataResponse> {
142-
return this.fetcher.post<CrossChainFulfillmentDataResponse>(
140+
request: CrossChainFulfillmentRequest,
141+
): Promise<CrossChainFulfillmentResponse> {
142+
return this.fetcher.post<CrossChainFulfillmentResponse>(
143143
getCrossChainFulfillmentDataPath(),
144144
request,
145145
)

src/api/types.ts

Lines changed: 12 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,60 +1298,15 @@ export type ValidateMetadataResponse = {
12981298
export type GetNFTMetadataResponse = AssetMetadataResponse
12991299

13001300
// ─── Cross-chain fulfillment types ──────────────────────────────────
1301-
1302-
/**
1303-
* A single listing to fulfill in a cross-chain fulfillment request.
1304-
* @category API Models
1305-
*/
1306-
export type CrossChainListing = {
1307-
/** Order hash (66 chars, starts with 0x) */
1308-
hash: string
1309-
/** Chain slug where the listing lives (must be EVM) */
1310-
chain: string
1311-
/** Seaport contract address */
1312-
protocol_address: string
1313-
}
1314-
1315-
/**
1316-
* Request body for the cross-chain fulfillment endpoint.
1317-
* @category API Query Args
1318-
*/
1319-
export type CrossChainFulfillmentDataRequest = {
1320-
/** Array of listings to fulfill (up to 50) */
1321-
listings: CrossChainListing[]
1322-
/** The buyer's wallet */
1323-
fulfiller: { address: string }
1324-
/** Payment token details */
1325-
payment: {
1326-
/** Chain slug of the payment token (EVM or SVM) */
1327-
chain: string
1328-
/** Payment token contract address (0x0...0 for native, Base58 for Solana) */
1329-
token_address: string
1330-
}
1331-
/** Optional: different recipient address for the NFTs */
1332-
recipient?: string
1333-
}
1334-
1335-
/**
1336-
* A single transaction returned by the cross-chain fulfillment endpoint.
1337-
* @category API Response Types
1338-
*/
1339-
export type CrossChainTransaction = {
1340-
/** Chain slug for the transaction */
1341-
chain: string
1342-
/** Contract address to call */
1343-
to: string
1344-
/** Encoded calldata */
1345-
data: string
1346-
/** Wei amount as string */
1347-
value: string
1348-
}
1349-
1350-
/**
1351-
* Response from the cross-chain fulfillment endpoint.
1352-
* @category API Response Types
1353-
*/
1354-
export type CrossChainFulfillmentDataResponse = {
1355-
/** Ordered list of transactions to sign and submit */
1356-
transactions: CrossChainTransaction[]
1357-
}
1301+
// Re-exported from @opensea/api-types so consumers can keep importing them
1302+
// from @opensea/sdk. See packages/api-types — these are generated from the
1303+
// OpenSea v2 OpenAPI spec.
1304+
1305+
export type {
1306+
CrossChainFulfillmentRequest,
1307+
CrossChainFulfillmentResponse,
1308+
CrossChainPaymentToken,
1309+
FulfillerObject,
1310+
ListingObject,
1311+
SwapTransactionResponse,
1312+
} from "@opensea/api-types"

test/api/listings.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, expect, test, vi } from "vitest"
22
import { ListingsAPI } from "../../src/api/listings"
33
import type {
4-
CrossChainFulfillmentDataResponse,
4+
CrossChainFulfillmentResponse,
55
GetBestListingResponse,
66
GetListingsResponse,
77
Listing,
@@ -730,7 +730,7 @@ describe("API: ListingsAPI", () => {
730730

731731
describe("getCrossChainFulfillmentData", () => {
732732
test("posts to the correct endpoint with the full request body", async () => {
733-
const mockResponse: CrossChainFulfillmentDataResponse = {
733+
const mockResponse: CrossChainFulfillmentResponse = {
734734
transactions: [
735735
{ chain: "ethereum", to: "0xabc", data: "0x123", value: "0" },
736736
],

0 commit comments

Comments
 (0)