opensea-cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,493 @@
1
+ type Chain = "ethereum" | "polygon" | "base" | "blast" | "arbitrum" | "avalanche" | "optimism" | "solana" | "zora" | "sei" | "b3" | "bera_chain" | "ape_chain" | "flow" | "ronin" | "abstract" | "shape" | "unichain" | "gunzilla" | "hyperevm" | "somnia" | "monad";
2
+ type SafelistStatus = "not_requested" | "requested" | "approved" | "verified" | "disabled_top_trending";
3
+ type CollectionOrderBy = "created_date" | "one_day_change" | "seven_day_volume" | "seven_day_change" | "num_owners" | "market_cap";
4
+ type EventType = "sale" | "transfer" | "mint" | "listing" | "offer" | "trait_offer" | "collection_offer";
5
+ type OrderSide = "ask" | "bid";
6
+ interface Fee {
7
+ fee: number;
8
+ recipient: string;
9
+ required: boolean;
10
+ }
11
+ interface PaymentToken {
12
+ name: string;
13
+ symbol: string;
14
+ decimals: number;
15
+ address: string;
16
+ chain: Chain;
17
+ image_url?: string;
18
+ eth_price?: string;
19
+ usd_price?: string;
20
+ }
21
+ interface Collection {
22
+ name: string;
23
+ collection: string;
24
+ description: string;
25
+ image_url: string;
26
+ banner_image_url: string;
27
+ owner: string;
28
+ safelist_status: SafelistStatus;
29
+ category: string;
30
+ is_disabled: boolean;
31
+ is_nsfw: boolean;
32
+ trait_offers_enabled: boolean;
33
+ collection_offers_enabled: boolean;
34
+ opensea_url: string;
35
+ project_url: string;
36
+ wiki_url: string;
37
+ discord_url: string;
38
+ telegram_url: string;
39
+ twitter_username: string;
40
+ instagram_username: string;
41
+ contracts: {
42
+ address: string;
43
+ chain: Chain;
44
+ }[];
45
+ editors: string[];
46
+ fees: Fee[];
47
+ rarity: {
48
+ strategy_id: string;
49
+ strategy_version: string;
50
+ calculated_at: string;
51
+ max_rank: number;
52
+ tokens_scored: number;
53
+ } | null;
54
+ payment_tokens: PaymentToken[];
55
+ total_supply: number;
56
+ created_date: string;
57
+ required_zone?: string;
58
+ }
59
+ interface CollectionStats {
60
+ total: {
61
+ volume: number;
62
+ sales: number;
63
+ average_price: number;
64
+ num_owners: number;
65
+ market_cap: number;
66
+ floor_price: number;
67
+ floor_price_symbol: string;
68
+ };
69
+ intervals: {
70
+ interval: "one_day" | "seven_day" | "thirty_day";
71
+ volume: number;
72
+ volume_diff: number;
73
+ volume_change: number;
74
+ sales: number;
75
+ sales_diff: number;
76
+ average_price: number;
77
+ }[];
78
+ }
79
+ interface NFT {
80
+ identifier: string;
81
+ collection: string;
82
+ contract: string;
83
+ token_standard: string;
84
+ name: string;
85
+ description: string;
86
+ image_url: string;
87
+ metadata_url: string;
88
+ opensea_url: string;
89
+ updated_at: string;
90
+ is_disabled: boolean;
91
+ is_nsfw: boolean;
92
+ traits: Trait[] | null;
93
+ creator: string;
94
+ owners: {
95
+ address: string;
96
+ quantity: number;
97
+ }[];
98
+ rarity: {
99
+ strategy_id: string | null;
100
+ strategy_version: string | null;
101
+ rank: number | null;
102
+ score: number | null;
103
+ calculated_at: string;
104
+ max_rank: number | null;
105
+ tokens_scored: number | null;
106
+ ranking_features: {
107
+ unique_attribute_count: number;
108
+ } | null;
109
+ } | null;
110
+ }
111
+ interface Trait {
112
+ trait_type: string;
113
+ display_type: string;
114
+ max_value: string;
115
+ value: string | number;
116
+ }
117
+ interface Price {
118
+ currency: string;
119
+ decimals: number;
120
+ value: string;
121
+ }
122
+ interface Order {
123
+ order_hash: string;
124
+ chain: string;
125
+ protocol_data: Record<string, unknown>;
126
+ protocol_address: string;
127
+ price: Price;
128
+ }
129
+ interface Offer extends Order {
130
+ criteria?: {
131
+ collection: {
132
+ slug: string;
133
+ };
134
+ contract: {
135
+ address: string;
136
+ };
137
+ encoded_token_ids?: string;
138
+ trait?: {
139
+ type: string;
140
+ value: string;
141
+ };
142
+ };
143
+ status: string;
144
+ }
145
+ interface Listing extends Omit<Order, "price"> {
146
+ type: string;
147
+ price: {
148
+ current: Price;
149
+ };
150
+ remaining_quantity: number;
151
+ status: string;
152
+ }
153
+ interface EventPayment {
154
+ quantity: string;
155
+ token_address: string;
156
+ decimals: number;
157
+ symbol: string;
158
+ }
159
+ interface EventAsset {
160
+ identifier: string;
161
+ collection: string;
162
+ contract: string;
163
+ token_standard: string;
164
+ name: string;
165
+ description: string;
166
+ image_url: string;
167
+ metadata_url: string;
168
+ opensea_url: string;
169
+ updated_at: string;
170
+ is_disabled: boolean;
171
+ is_nsfw: boolean;
172
+ }
173
+ interface AssetEvent {
174
+ event_type: string;
175
+ event_timestamp: number;
176
+ chain: string;
177
+ quantity: number;
178
+ [key: string]: unknown;
179
+ }
180
+ interface Contract {
181
+ address: string;
182
+ chain: string;
183
+ collection: string | null;
184
+ name: string;
185
+ contract_standard: string;
186
+ }
187
+ interface Account {
188
+ address: string;
189
+ username: string;
190
+ profile_image_url: string;
191
+ banner_image_url: string;
192
+ website: string;
193
+ social_media_accounts: {
194
+ platform: string;
195
+ username: string;
196
+ }[];
197
+ bio: string;
198
+ joined_date: string;
199
+ }
200
+ interface TraitCategories {
201
+ [traitType: string]: "string" | "number" | "date";
202
+ }
203
+ interface TraitCounts {
204
+ [traitValue: string]: number;
205
+ }
206
+ interface GetTraitsResponse {
207
+ categories: TraitCategories;
208
+ counts: {
209
+ [traitType: string]: TraitCounts;
210
+ };
211
+ }
212
+ interface PaginatedResponse<T> {
213
+ next?: string;
214
+ results: T[];
215
+ }
216
+ interface Token {
217
+ address: string;
218
+ chain: string;
219
+ name: string;
220
+ symbol: string;
221
+ image_url?: string;
222
+ usd_price: string;
223
+ decimals: number;
224
+ market_cap_usd?: number;
225
+ volume_24h?: number;
226
+ price_change_24h?: number;
227
+ opensea_url: string;
228
+ }
229
+ interface TokenDetails {
230
+ address: string;
231
+ chain: string;
232
+ name: string;
233
+ symbol: string;
234
+ image_url?: string;
235
+ description?: string;
236
+ usd_price: string;
237
+ decimals: number;
238
+ stats?: TokenStats;
239
+ socials?: TokenSocials;
240
+ opensea_url: string;
241
+ }
242
+ interface TokenStats {
243
+ market_cap_usd?: number;
244
+ fdv_usd?: number;
245
+ circulating_supply?: number;
246
+ max_supply?: number;
247
+ total_supply?: number;
248
+ volume_24h?: number;
249
+ price_change_1h?: number;
250
+ price_change_24h?: number;
251
+ price_change_7d?: number;
252
+ price_change_30d?: number;
253
+ }
254
+ interface TokenSocials {
255
+ website?: string;
256
+ twitter_handle?: string;
257
+ telegram_identifier?: string;
258
+ }
259
+ interface SwapQuote {
260
+ total_price_usd: number;
261
+ total_cost_usd: number;
262
+ slippage_tolerance: number;
263
+ estimated_duration_ms: number;
264
+ marketplace_fee_bps: number;
265
+ }
266
+ interface SwapTransaction {
267
+ chain: string;
268
+ to?: string;
269
+ data: string;
270
+ value?: string;
271
+ }
272
+ interface SwapQuoteResponse {
273
+ quote: SwapQuote;
274
+ transactions: SwapTransaction[];
275
+ }
276
+
277
+ interface OpenSeaClientConfig {
278
+ apiKey: string;
279
+ baseUrl?: string;
280
+ chain?: string;
281
+ }
282
+ interface CommandOptions {
283
+ apiKey?: string;
284
+ chain?: string;
285
+ format?: "json" | "table";
286
+ raw?: boolean;
287
+ }
288
+
289
+ declare class OpenSeaClient {
290
+ private apiKey;
291
+ private baseUrl;
292
+ private defaultChain;
293
+ constructor(config: OpenSeaClientConfig);
294
+ get<T>(path: string, params?: Record<string, unknown>): Promise<T>;
295
+ post<T>(path: string): Promise<T>;
296
+ getDefaultChain(): string;
297
+ }
298
+ declare class OpenSeaAPIError extends Error {
299
+ statusCode: number;
300
+ responseBody: string;
301
+ path: string;
302
+ constructor(statusCode: number, responseBody: string, path: string);
303
+ }
304
+
305
+ declare class OpenSeaCLI {
306
+ private client;
307
+ readonly collections: CollectionsAPI;
308
+ readonly nfts: NFTsAPI;
309
+ readonly listings: ListingsAPI;
310
+ readonly offers: OffersAPI;
311
+ readonly events: EventsAPI;
312
+ readonly accounts: AccountsAPI;
313
+ readonly tokens: TokensAPI;
314
+ readonly swaps: SwapsAPI;
315
+ constructor(config: OpenSeaClientConfig);
316
+ }
317
+ declare class CollectionsAPI {
318
+ private client;
319
+ constructor(client: OpenSeaClient);
320
+ get(slug: string): Promise<Collection>;
321
+ list(options?: {
322
+ chain?: Chain;
323
+ limit?: number;
324
+ next?: string;
325
+ orderBy?: CollectionOrderBy;
326
+ creatorUsername?: string;
327
+ includeHidden?: boolean;
328
+ }): Promise<{
329
+ collections: Collection[];
330
+ next?: string;
331
+ }>;
332
+ stats(slug: string): Promise<CollectionStats>;
333
+ traits(slug: string): Promise<GetTraitsResponse>;
334
+ }
335
+ declare class NFTsAPI {
336
+ private client;
337
+ constructor(client: OpenSeaClient);
338
+ get(chain: Chain, address: string, identifier: string): Promise<{
339
+ nft: NFT;
340
+ }>;
341
+ listByCollection(slug: string, options?: {
342
+ limit?: number;
343
+ next?: string;
344
+ }): Promise<{
345
+ nfts: NFT[];
346
+ next?: string;
347
+ }>;
348
+ listByContract(chain: Chain, address: string, options?: {
349
+ limit?: number;
350
+ next?: string;
351
+ }): Promise<{
352
+ nfts: NFT[];
353
+ next?: string;
354
+ }>;
355
+ listByAccount(chain: Chain, address: string, options?: {
356
+ limit?: number;
357
+ next?: string;
358
+ }): Promise<{
359
+ nfts: NFT[];
360
+ next?: string;
361
+ }>;
362
+ refresh(chain: Chain, address: string, identifier: string): Promise<void>;
363
+ getContract(chain: Chain, address: string): Promise<Contract>;
364
+ }
365
+ declare class ListingsAPI {
366
+ private client;
367
+ constructor(client: OpenSeaClient);
368
+ all(collectionSlug: string, options?: {
369
+ limit?: number;
370
+ next?: string;
371
+ }): Promise<{
372
+ listings: Listing[];
373
+ next?: string;
374
+ }>;
375
+ best(collectionSlug: string, options?: {
376
+ limit?: number;
377
+ next?: string;
378
+ }): Promise<{
379
+ listings: Listing[];
380
+ next?: string;
381
+ }>;
382
+ bestForNFT(collectionSlug: string, tokenId: string): Promise<Listing>;
383
+ }
384
+ declare class OffersAPI {
385
+ private client;
386
+ constructor(client: OpenSeaClient);
387
+ all(collectionSlug: string, options?: {
388
+ limit?: number;
389
+ next?: string;
390
+ }): Promise<{
391
+ offers: Offer[];
392
+ next?: string;
393
+ }>;
394
+ collection(collectionSlug: string, options?: {
395
+ limit?: number;
396
+ next?: string;
397
+ }): Promise<{
398
+ offers: Offer[];
399
+ next?: string;
400
+ }>;
401
+ bestForNFT(collectionSlug: string, tokenId: string): Promise<Offer>;
402
+ traits(collectionSlug: string, options: {
403
+ type: string;
404
+ value: string;
405
+ limit?: number;
406
+ next?: string;
407
+ }): Promise<{
408
+ offers: Offer[];
409
+ next?: string;
410
+ }>;
411
+ }
412
+ declare class EventsAPI {
413
+ private client;
414
+ constructor(client: OpenSeaClient);
415
+ list(options?: {
416
+ eventType?: EventType;
417
+ after?: number;
418
+ before?: number;
419
+ limit?: number;
420
+ next?: string;
421
+ chain?: Chain;
422
+ }): Promise<{
423
+ asset_events: AssetEvent[];
424
+ next?: string;
425
+ }>;
426
+ byAccount(address: string, options?: {
427
+ eventType?: EventType;
428
+ limit?: number;
429
+ next?: string;
430
+ chain?: Chain;
431
+ }): Promise<{
432
+ asset_events: AssetEvent[];
433
+ next?: string;
434
+ }>;
435
+ byCollection(collectionSlug: string, options?: {
436
+ eventType?: EventType;
437
+ limit?: number;
438
+ next?: string;
439
+ }): Promise<{
440
+ asset_events: AssetEvent[];
441
+ next?: string;
442
+ }>;
443
+ byNFT(chain: Chain, address: string, identifier: string, options?: {
444
+ eventType?: EventType;
445
+ limit?: number;
446
+ next?: string;
447
+ }): Promise<{
448
+ asset_events: AssetEvent[];
449
+ next?: string;
450
+ }>;
451
+ }
452
+ declare class AccountsAPI {
453
+ private client;
454
+ constructor(client: OpenSeaClient);
455
+ get(address: string): Promise<Account>;
456
+ }
457
+ declare class TokensAPI {
458
+ private client;
459
+ constructor(client: OpenSeaClient);
460
+ trending(options?: {
461
+ limit?: number;
462
+ chains?: string[];
463
+ cursor?: string;
464
+ }): Promise<{
465
+ tokens: Token[];
466
+ next?: string;
467
+ }>;
468
+ top(options?: {
469
+ limit?: number;
470
+ chains?: string[];
471
+ cursor?: string;
472
+ }): Promise<{
473
+ tokens: Token[];
474
+ next?: string;
475
+ }>;
476
+ get(chain: Chain, address: string): Promise<TokenDetails>;
477
+ }
478
+ declare class SwapsAPI {
479
+ private client;
480
+ constructor(client: OpenSeaClient);
481
+ quote(options: {
482
+ fromChain: string;
483
+ fromAddress: string;
484
+ toChain: string;
485
+ toAddress: string;
486
+ quantity: string;
487
+ address: string;
488
+ slippage?: number;
489
+ recipient?: string;
490
+ }): Promise<SwapQuoteResponse>;
491
+ }
492
+
493
+ export { type Account, type AssetEvent, type Chain, type Collection, type CollectionOrderBy, type CollectionStats, type CommandOptions, type Contract, type EventAsset, type EventPayment, type EventType, type Fee, type GetTraitsResponse, type Listing, type NFT, type Offer, OpenSeaAPIError, OpenSeaCLI, OpenSeaClient, type OpenSeaClientConfig, type Order, type OrderSide, type PaginatedResponse, type PaymentToken, type Price, type SafelistStatus, type SwapQuote, type SwapQuoteResponse, type SwapTransaction, type Token, type TokenDetails, type TokenSocials, type TokenStats, type Trait, type TraitCategories, type TraitCounts };