Skip to content

Commit 6e465a4

Browse files
committed
Release v0.4.1
Origin-SHA: 80b8f2d8e447ef759b90b6d0a05139acddb8e76c
1 parent fb42659 commit 6e465a4

6 files changed

Lines changed: 97 additions & 8 deletions

File tree

CHANGELOG.md

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

3+
## 0.4.1
4+
5+
### Patch Changes
6+
7+
- 7969189: Sync OpenAPI spec — pure additive: `Order.asset` and `NftDetailed.subscription` field additions plus pagination defaults loosened on `/api/v2/collections`.
8+
9+
**New on `Order`:**
10+
11+
- `asset?: OrderAsset``{ identifier?: string; contract: string }`. Surfaces the NFT contract + token ID without loading `protocol_data`. `identifier` is null for collection/criteria offers. Powers the profile endpoints (`/account/{address}/listings`, `/offers`, `/offers_received`) where `protocol_data` is intentionally null for performance. Source: ProjectOpenSea/os2-core#42022.
12+
13+
**New on `NftDetailed`:**
14+
15+
- `subscription?: SubscriptionInfoResponse``{ expires_at?: string; is_renewable: boolean; is_expired: boolean }`.
16+
17+
**Loosened on `GET /api/v2/collections`:**
18+
19+
- `limit` default `10``20`, max `100``200`.
20+
21+
**Named exports added:** `OrderAsset`, `SubscriptionInfoResponse`.
22+
23+
**Tooling:** `update-spec` now runs `biome format` on the output so future syncs don't churn on formatter differences.
24+
325
## 0.4.0
426

527
### Minor Changes

opensea-api.json

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2906,17 +2906,17 @@
29062906
{
29072907
"name": "limit",
29082908
"in": "query",
2909-
"description": "Number of collections to return per page",
2909+
"description": "Number of items to return per page",
29102910
"required": false,
29112911
"schema": {
29122912
"type": "integer",
29132913
"format": "int32",
2914-
"description": "Number of collections to return per page",
2915-
"example": 10,
2916-
"maximum": 100,
2914+
"description": "Number of items to return per page",
2915+
"example": 20,
2916+
"maximum": 200,
29172917
"minimum": 1
29182918
},
2919-
"example": 10
2919+
"example": 20
29202920
},
29212921
{
29222922
"name": "next.value",
@@ -6108,6 +6108,9 @@
61086108
"protocol_address": {
61096109
"type": "string"
61106110
},
6111+
"asset": {
6112+
"$ref": "#/components/schemas/OrderAsset"
6113+
},
61116114
"remaining_quantity": {
61126115
"type": "integer",
61136116
"format": "int64"
@@ -6158,6 +6161,9 @@
61586161
"protocol_address": {
61596162
"type": "string"
61606163
},
6164+
"asset": {
6165+
"$ref": "#/components/schemas/OrderAsset"
6166+
},
61616167
"remaining_quantity": {
61626168
"type": "integer",
61636169
"format": "int64"
@@ -6169,6 +6175,18 @@
61696175
},
61706176
"required": ["chain", "order_hash", "remaining_quantity"]
61716177
},
6178+
"OrderAsset": {
6179+
"type": "object",
6180+
"properties": {
6181+
"identifier": {
6182+
"type": "string"
6183+
},
6184+
"contract": {
6185+
"type": "string"
6186+
}
6187+
},
6188+
"required": ["contract"]
6189+
},
61726190
"Parameters": {
61736191
"type": "object",
61746192
"properties": {
@@ -6292,6 +6310,9 @@
62926310
"protocol_address": {
62936311
"type": "string"
62946312
},
6313+
"asset": {
6314+
"$ref": "#/components/schemas/OrderAsset"
6315+
},
62956316
"remaining_quantity": {
62966317
"type": "integer",
62976318
"format": "int64"
@@ -7499,6 +7520,9 @@
74997520
},
75007521
"rarity": {
75017522
"$ref": "#/components/schemas/Rarity"
7523+
},
7524+
"subscription": {
7525+
"$ref": "#/components/schemas/SubscriptionInfoResponse"
75027526
}
75037527
},
75047528
"required": [
@@ -7548,6 +7572,22 @@
75487572
},
75497573
"required": ["strategy_id", "strategy_version"]
75507574
},
7575+
"SubscriptionInfoResponse": {
7576+
"type": "object",
7577+
"properties": {
7578+
"expires_at": {
7579+
"type": "string",
7580+
"format": "date-time"
7581+
},
7582+
"is_renewable": {
7583+
"type": "boolean"
7584+
},
7585+
"is_expired": {
7586+
"type": "boolean"
7587+
}
7588+
},
7589+
"required": ["is_expired", "is_renewable"]
7590+
},
75517591
"Trait": {
75527592
"type": "object",
75537593
"properties": {

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.4.0",
3+
"version": "0.4.1",
44
"description": "Auto-generated TypeScript types from the OpenSea API OpenAPI spec",
55
"license": "MIT",
66
"author": "OpenSea Developers",

scripts/update-spec.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* node scripts/update-spec.mjs
99
*/
1010

11+
import { execFileSync } from "node:child_process";
1112
import { existsSync, writeFileSync } from "node:fs";
1213
import { resolve, dirname } from "node:path";
1314
import { fileURLToPath } from "node:url";
@@ -31,6 +32,16 @@ try {
3132
`${Object.keys(spec.paths || {}).length} paths, ` +
3233
`${Object.keys(spec.components?.schemas || {}).length} schemas`,
3334
);
35+
36+
// Match the repo's JSON formatting (biome inlines short arrays at lineWidth
37+
// 80) so diffs reflect real spec changes, not formatter drift.
38+
try {
39+
execFileSync("pnpm", ["exec", "biome", "format", "--write", outPath], {
40+
stdio: "inherit",
41+
});
42+
} catch (err) {
43+
console.warn(`biome format failed (continuing): ${err.message}`);
44+
}
3445
} catch (err) {
3546
console.error(`Failed to fetch spec: ${err.message}`);
3647
if (existsSync(outPath)) {

src/generated.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,6 +2075,7 @@ export interface components {
20752075
chain: string;
20762076
protocol_data?: components["schemas"]["ProtocolData"];
20772077
protocol_address?: string;
2078+
asset?: components["schemas"]["OrderAsset"];
20782079
/** Format: int64 */
20792080
remaining_quantity: number;
20802081
/** Format: int64 */
@@ -2089,11 +2090,16 @@ export interface components {
20892090
chain: string;
20902091
protocol_data?: components["schemas"]["ProtocolData"];
20912092
protocol_address?: string;
2093+
asset?: components["schemas"]["OrderAsset"];
20922094
/** Format: int64 */
20932095
remaining_quantity: number;
20942096
/** Format: int64 */
20952097
order_created_at?: number;
20962098
};
2099+
OrderAsset: {
2100+
identifier?: string;
2101+
contract: string;
2102+
};
20972103
Parameters: {
20982104
offerer: string;
20992105
offer: components["schemas"]["Item"][];
@@ -2129,6 +2135,7 @@ export interface components {
21292135
chain: string;
21302136
protocol_data?: components["schemas"]["ProtocolData"];
21312137
protocol_address?: string;
2138+
asset?: components["schemas"]["OrderAsset"];
21322139
/** Format: int64 */
21332140
remaining_quantity: number;
21342141
/** Format: int64 */
@@ -2491,6 +2498,7 @@ export interface components {
24912498
creator: string;
24922499
owners: components["schemas"]["Owner"][];
24932500
rarity?: components["schemas"]["Rarity"];
2501+
subscription?: components["schemas"]["SubscriptionInfoResponse"];
24942502
};
24952503
Owner: {
24962504
address: string;
@@ -2504,6 +2512,12 @@ export interface components {
25042512
/** Format: int64 */
25052513
rank?: number;
25062514
};
2515+
SubscriptionInfoResponse: {
2516+
/** Format: date-time */
2517+
expires_at?: string;
2518+
is_renewable: boolean;
2519+
is_expired: boolean;
2520+
};
25072521
Trait: {
25082522
trait_type: string;
25092523
display_type?: string;
@@ -5633,8 +5647,8 @@ export interface operations {
56335647
parameters: {
56345648
query?: {
56355649
/**
5636-
* @description Number of collections to return per page
5637-
* @example 10
5650+
* @description Number of items to return per page
5651+
* @example 20
56385652
*/
56395653
limit?: number;
56405654
"next.value"?: string;

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export type Trait = Schemas["Trait"]
5353
export type TraitData = Schemas["TraitData"]
5454
export type NumericTraitData = Schemas["NumericTraitData"]
5555
export type NumericTraitCriteria = Schemas["NumericTraitCriteria"]
56+
export type SubscriptionInfoResponse = Schemas["SubscriptionInfoResponse"]
5657

5758
// NFTs — batch
5859
export type BatchNftsRequest = Schemas["BatchNftsRequest"]
@@ -66,6 +67,7 @@ export type NftSalePointResponse = Schemas["NftSalePointResponse"]
6667

6768
// Orders
6869
export type Order = Schemas["Order"]
70+
export type OrderAsset = Schemas["OrderAsset"]
6971
export type Offer = Schemas["Offer"]
7072
export type Listing = Schemas["Listing"]
7173
export type OffersResponse = Schemas["OffersResponse"]

0 commit comments

Comments
 (0)