Skip to content

Commit 67fd650

Browse files
Release v0.2.3
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent f297e23 commit 67fd650

6 files changed

Lines changed: 281 additions & 43 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ When reviewing changes to this package, verify:
3737
pnpm --filter cli run build
3838
```
3939

40+
**Always-update-this-first rule**: when adding a new OpenSea v2 endpoint to the SDK or CLI, refresh the spec and regenerate types here BEFORE writing the SDK/CLI method. Hand-rolling request/response types in `packages/sdk/src/api/types.ts` or `packages/cli/src/types/api.ts` is forbidden and CI will block it (`pnpm check-api-paths`).
41+
4042
4. **Chain enum sync**: The SDK's `Chain` enum has a compile-time assertion against `ChainIdentifier` from this package. If the spec adds a new chain, the SDK build will fail until `Chain` is updated.
4143

4244
## Conventions

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# @opensea/api-types
22

3+
## 0.2.3
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+
329
## 0.2.2
430

531
### Patch Changes

opensea-api.json

Lines changed: 137 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,49 @@
690690
}
691691
}
692692
},
693+
"/api/v2/listings/cross_chain_fulfillment_data": {
694+
"post": {
695+
"tags": ["Listing Endpoints"],
696+
"summary": "Fulfill a listing using a different token",
697+
"description": "Get fulfillment data to buy one or more listings using a token on a different chain or a different token on the same chain. Supports cross-chain purchases and same-chain token swaps via the Relay protocol. Returns an ordered list of transactions to execute.",
698+
"operationId": "generate_cross_chain_listing_fulfillment_data",
699+
"requestBody": {
700+
"content": {
701+
"application/json": {
702+
"schema": {
703+
"$ref": "#/components/schemas/CrossChainFulfillmentRequest"
704+
}
705+
}
706+
},
707+
"required": true
708+
},
709+
"responses": {
710+
"200": {
711+
"description": "Cross-chain fulfillment data retrieved successfully",
712+
"content": {
713+
"*/*": {
714+
"schema": {
715+
"$ref": "#/components/schemas/CrossChainFulfillmentResponse"
716+
}
717+
}
718+
}
719+
},
720+
"400": {
721+
"description": "The request is invalid. Possible reasons: listing not found, listing not valid, listing is not a listing order, or no fulfillment actions could be generated.",
722+
"content": {
723+
"*/*": {
724+
"schema": {
725+
"$ref": "#/components/schemas/CrossChainFulfillmentResponse"
726+
}
727+
}
728+
}
729+
},
730+
"500": {
731+
"$ref": "#/components/responses/InternalError"
732+
}
733+
}
734+
}
735+
},
693736
"/api/v2/drops/{slug}/mint": {
694737
"post": {
695738
"tags": ["Drops Endpoints"],
@@ -5640,6 +5683,86 @@
56405683
},
56415684
"required": ["chain", "hash", "protocol_address"]
56425685
},
5686+
"CrossChainFulfillmentRequest": {
5687+
"type": "object",
5688+
"description": "Request to fulfill one or more listings using a payment token on a different chain or a different token on the same chain",
5689+
"properties": {
5690+
"listings": {
5691+
"type": "array",
5692+
"description": "One or more listings to fulfill",
5693+
"items": {
5694+
"$ref": "#/components/schemas/ListingObject"
5695+
}
5696+
},
5697+
"fulfiller": {
5698+
"$ref": "#/components/schemas/FulfillerObject"
5699+
},
5700+
"payment": {
5701+
"$ref": "#/components/schemas/CrossChainPaymentToken",
5702+
"description": "The token to pay with"
5703+
},
5704+
"recipient": {
5705+
"type": "string",
5706+
"description": "Optional recipient address for the purchased items"
5707+
}
5708+
},
5709+
"required": ["fulfiller", "listings", "payment"]
5710+
},
5711+
"CrossChainPaymentToken": {
5712+
"type": "object",
5713+
"description": "Payment token to use for cross-chain fulfillment",
5714+
"properties": {
5715+
"chain": {
5716+
"type": "string",
5717+
"description": "Chain of the payment token (e.g. 'base', 'ethereum')",
5718+
"example": "base"
5719+
},
5720+
"token_address": {
5721+
"type": "string",
5722+
"description": "Contract address of the payment token (use 0x0000000000000000000000000000000000000000 for native token)",
5723+
"example": "0x0000000000000000000000000000000000000000"
5724+
}
5725+
},
5726+
"required": ["chain", "token_address"]
5727+
},
5728+
"CrossChainFulfillmentResponse": {
5729+
"type": "object",
5730+
"description": "Response containing ordered transactions to execute for cross-chain fulfillment",
5731+
"properties": {
5732+
"transactions": {
5733+
"type": "array",
5734+
"description": "Ordered list of transactions to execute. May include approval and buy/swap transactions.",
5735+
"items": {
5736+
"$ref": "#/components/schemas/SwapTransactionResponse"
5737+
}
5738+
}
5739+
},
5740+
"required": ["transactions"]
5741+
},
5742+
"SwapTransactionResponse": {
5743+
"type": "object",
5744+
"description": "A transaction to be submitted onchain to execute a swap",
5745+
"properties": {
5746+
"chain": {
5747+
"type": "string",
5748+
"description": "The blockchain for this transaction",
5749+
"example": "ethereum"
5750+
},
5751+
"to": {
5752+
"type": "string",
5753+
"description": "The destination address for the transaction"
5754+
},
5755+
"data": {
5756+
"type": "string",
5757+
"description": "The transaction data. For EVM chains: hex-encoded calldata. For SVM chains: comma-separated instructions in programId:data format."
5758+
},
5759+
"value": {
5760+
"type": "string",
5761+
"description": "The native token value to send with the transaction"
5762+
}
5763+
},
5764+
"required": ["chain", "data"]
5765+
},
56435766
"DropMintResponse": {
56445767
"type": "object",
56455768
"description": "Ready-to-sign mint transaction data",
@@ -5904,7 +6027,7 @@
59046027
"usd_price": {
59056028
"type": "string",
59066029
"description": "Current price in USD",
5907-
"example": 1
6030+
"example": 1.0
59086031
},
59096032
"decimals": {
59106033
"type": "integer",
@@ -6192,7 +6315,7 @@
61926315
"type": "number",
61936316
"format": "double",
61946317
"description": "Total cost of tokens sent in USD",
6195-
"example": 1869
6318+
"example": 1869.0
61966319
},
61976320
"slippage_tolerance": {
61986321
"type": "number",
@@ -6239,30 +6362,6 @@
62396362
},
62406363
"required": ["quote", "transactions"]
62416364
},
6242-
"SwapTransactionResponse": {
6243-
"type": "object",
6244-
"description": "A transaction to be submitted onchain to execute a swap",
6245-
"properties": {
6246-
"chain": {
6247-
"type": "string",
6248-
"description": "The blockchain for this transaction",
6249-
"example": "ethereum"
6250-
},
6251-
"to": {
6252-
"type": "string",
6253-
"description": "The destination address for the transaction"
6254-
},
6255-
"data": {
6256-
"type": "string",
6257-
"description": "The transaction data. For EVM chains: hex-encoded calldata. For SVM chains: comma-separated instructions in programId:data format."
6258-
},
6259-
"value": {
6260-
"type": "string",
6261-
"description": "The native token value to send with the transaction"
6262-
}
6263-
},
6264-
"required": ["chain", "data"]
6265-
},
62666365
"AccountSearchResponse": {
62676366
"type": "object",
62686367
"description": "Account search result",
@@ -7516,7 +7615,7 @@
75167615
"usd_price": {
75177616
"type": "string",
75187617
"description": "Current price in USD",
7519-
"example": 1
7618+
"example": 1.0
75207619
},
75217620
"decimals": {
75227621
"type": "integer",
@@ -7893,7 +7992,7 @@
78937992
"usd_price": {
78947993
"type": "string",
78957994
"description": "Current price in USD",
7896-
"example": 1
7995+
"example": 1.0
78977996
},
78987997
"decimals": {
78997998
"type": "integer",
@@ -7920,6 +8019,16 @@
79208019
"default": "OK",
79218020
"description": "Token status relative to OpenSea's spam-classification rules. `OK` for tokens that pass all spam filters (the normal case); populated with a more specific value for tokens surfaced via `disable_spam_filtering=true` that would normally be hidden. Categories are intentionally broad and may evolve. Possible values, in decreasing severity: `WARNING` (flagged as risky/suspicious — caution advised), `SPAM` (flagged as spam), `LOW_LIQUIDITY` (insufficient pool liquidity), `LOW_VALUE` (dust holding < $0.01), `OK` (passes all filters).",
79228021
"enum": ["OK", "WARNING", "SPAM", "LOW_LIQUIDITY", "LOW_VALUE"]
8022+
},
8023+
"base_token_liquidity_usd": {
8024+
"type": "string",
8025+
"description": "USD value of base token reserves in the top liquidity pool paired with a major token",
8026+
"example": 125000.5
8027+
},
8028+
"quote_token_liquidity_usd": {
8029+
"type": "string",
8030+
"description": "USD value of quote token reserves in the top liquidity pool paired with a major token",
8031+
"example": 125000.5
79238032
}
79248033
},
79258034
"required": [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opensea/api-types",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"description": "Auto-generated TypeScript types from the OpenSea API OpenAPI spec",
55
"license": "MIT",
66
"author": "OpenSea Developers",

0 commit comments

Comments
 (0)