@opensea/sdk 12.11.4 → 12.13.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.
- package/README.md +2 -2
- package/lib/api/api.d.ts +3 -0
- package/lib/api/api.js +4 -0
- package/lib/api/api.js.map +1 -1
- package/lib/api/apiPaths.d.ts +10 -0
- package/lib/api/apiPaths.js +43 -2
- package/lib/api/apiPaths.js.map +1 -1
- package/lib/api/collections.d.ts +16 -1
- package/lib/api/collections.js +21 -0
- package/lib/api/collections.js.map +1 -1
- package/lib/api/nfts.d.ts +14 -1
- package/lib/api/nfts.js +17 -0
- package/lib/api/nfts.js.map +1 -1
- package/lib/api/tools.d.ts +45 -0
- package/lib/api/tools.js +64 -0
- package/lib/api/tools.js.map +1 -0
- package/lib/api/types.d.ts +155 -1
- package/lib/api/types.js.map +1 -1
- package/lib/api/uploadContext.d.ts +50 -0
- package/lib/api/uploadContext.js +144 -0
- package/lib/api/uploadContext.js.map +1 -0
- package/lib/api/walletAuth.d.ts +268 -0
- package/lib/api/walletAuth.js +41 -0
- package/lib/api/walletAuth.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/stream/transport/phoenix.d.ts +6 -0
- package/lib/stream/transport/phoenix.js +15 -9
- package/lib/stream/transport/phoenix.js.map +1 -1
- package/lib/viem.d.ts +1 -0
- package/lib/viem.js +1 -0
- package/lib/viem.js.map +1 -1
- package/package.json +2 -2
- package/src/api/api.ts +4 -0
- package/src/api/apiPaths.ts +48 -0
- package/src/api/collections.ts +47 -0
- package/src/api/nfts.ts +37 -0
- package/src/api/tools.ts +99 -0
- package/src/api/types.ts +209 -0
- package/src/api/uploadContext.ts +166 -0
- package/src/api/walletAuth.ts +84 -0
- package/src/index.ts +1 -0
- package/src/stream/transport/phoenix.ts +25 -9
- package/src/viem.ts +1 -0
package/src/api/apiPaths.ts
CHANGED
|
@@ -104,6 +104,14 @@ export const getListNFTsByCollectionPath = (slug: string) => {
|
|
|
104
104
|
return `${API_V2_PREFIX}/collection/${segment(slug)}/nfts`
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
export const getListNFTsByGroupPath = (group: string) => {
|
|
108
|
+
return `${API_V2_PREFIX}/nfts/group/${segment(group)}`
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export const getNFTGroupFacetsPath = (group: string) => {
|
|
112
|
+
return `${API_V2_PREFIX}/nfts/group/${segment(group)}/facets`
|
|
113
|
+
}
|
|
114
|
+
|
|
107
115
|
export const getListNFTsByContractPath = (chain: Chain, address: string) => {
|
|
108
116
|
return `${API_V2_PREFIX}/chain/${segment(chain)}/contract/${segment(address)}/nfts`
|
|
109
117
|
}
|
|
@@ -365,6 +373,18 @@ export const getCollectionFloorPricesPath = (slug: string) => {
|
|
|
365
373
|
return `${API_V2_PREFIX}/collections/${segment(slug)}/floor_prices`
|
|
366
374
|
}
|
|
367
375
|
|
|
376
|
+
export const getCreatorFeeEnforcementPath = (slug: string) => {
|
|
377
|
+
return `${API_V2_PREFIX}/collections/${segment(slug)}/creator_fee_enforcement`
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export const getCollectionPfpProfilesPath = (slug: string) => {
|
|
381
|
+
return `${API_V2_PREFIX}/collections/${segment(slug)}/pfp-profiles`
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export const getTopPfpCollectionsPath = () => {
|
|
385
|
+
return `${API_V2_PREFIX}/pfp/top-collections`
|
|
386
|
+
}
|
|
387
|
+
|
|
368
388
|
// ── Token analytics ─────────────────────────────────────────────────
|
|
369
389
|
|
|
370
390
|
export const getTokenPriceHistoryPath = (chain: Chain, address: string) => {
|
|
@@ -454,3 +474,31 @@ export const getWalletTokenTransfersPath = (address: string) => {
|
|
|
454
474
|
export const getProfileCollectionsPath = (address: string) => {
|
|
455
475
|
return `${API_V2_PREFIX}/account/${segment(address)}/collections`
|
|
456
476
|
}
|
|
477
|
+
|
|
478
|
+
export const getToolsPath = () => {
|
|
479
|
+
return `${API_V2_PREFIX}/tools`
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
export const getToolsSearchPath = () => {
|
|
483
|
+
return `${API_V2_PREFIX}/tools/search`
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export const getToolPath = (
|
|
487
|
+
registryChain: string | number,
|
|
488
|
+
registryAddr: string,
|
|
489
|
+
toolId: string | number,
|
|
490
|
+
) => {
|
|
491
|
+
return `${API_V2_PREFIX}/tools/${segment(registryChain)}/${segment(registryAddr)}/${segment(toolId)}`
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export const getToolActivityPath = (
|
|
495
|
+
registryChain: string | number,
|
|
496
|
+
registryAddr: string,
|
|
497
|
+
toolId: string | number,
|
|
498
|
+
) => {
|
|
499
|
+
return `${API_V2_PREFIX}/tools/${segment(registryChain)}/${segment(registryAddr)}/${segment(toolId)}/activity`
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
export const getToolUsagePath = () => {
|
|
503
|
+
return `${API_V2_PREFIX}/tools/usage`
|
|
504
|
+
}
|
package/src/api/collections.ts
CHANGED
|
@@ -5,10 +5,13 @@ import {
|
|
|
5
5
|
getCollectionHoldersPath,
|
|
6
6
|
getCollectionOfferAggregatesPath,
|
|
7
7
|
getCollectionPath,
|
|
8
|
+
getCollectionPfpProfilesPath,
|
|
8
9
|
getCollectionStatsPath,
|
|
9
10
|
getCollectionsPath,
|
|
10
11
|
getCollectionTraitFloorsPath,
|
|
12
|
+
getCreatorFeeEnforcementPath,
|
|
11
13
|
getTopCollectionsPath,
|
|
14
|
+
getTopPfpCollectionsPath,
|
|
12
15
|
getTraitsPath,
|
|
13
16
|
getTrendingCollectionsPath,
|
|
14
17
|
} from "./apiPaths"
|
|
@@ -21,15 +24,20 @@ import {
|
|
|
21
24
|
type CollectionHoldersPaginatedResponse,
|
|
22
25
|
type CollectionOfferAggregatesPaginatedResponse,
|
|
23
26
|
CollectionOrderByOption,
|
|
27
|
+
type CollectionPfpProfilesResponse,
|
|
28
|
+
type CreatorFeeEnforcementStatusResponse,
|
|
24
29
|
type FloorPriceHistoryResponse,
|
|
30
|
+
type GetCollectionPfpProfilesArgs,
|
|
25
31
|
type GetCollectionResponse,
|
|
26
32
|
type GetCollectionsArgs,
|
|
27
33
|
type GetCollectionsPaginatedResponse,
|
|
28
34
|
type GetCollectionsResponse,
|
|
29
35
|
type GetTopCollectionsArgs,
|
|
36
|
+
type GetTopPfpCollectionsArgs,
|
|
30
37
|
type GetTraitsResponse,
|
|
31
38
|
type GetTrendingCollectionsArgs,
|
|
32
39
|
type PaginatedAnalyticsArgs,
|
|
40
|
+
type TopPfpCollectionsResponse,
|
|
33
41
|
type TraitFloorsResponse,
|
|
34
42
|
} from "./types"
|
|
35
43
|
|
|
@@ -197,4 +205,43 @@ export class CollectionsAPI {
|
|
|
197
205
|
args,
|
|
198
206
|
)
|
|
199
207
|
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Fetch whether creator fees are enforced onchain for a collection, and whether its contract
|
|
211
|
+
* supports turning enforcement on with `walletAuth.buildCreatorFeeEnforcementTransactions`.
|
|
212
|
+
*/
|
|
213
|
+
async getCreatorFeeEnforcement(
|
|
214
|
+
slug: string,
|
|
215
|
+
): Promise<CreatorFeeEnforcementStatusResponse> {
|
|
216
|
+
return this.fetcher.get<CreatorFeeEnforcementStatusResponse>(
|
|
217
|
+
getCreatorFeeEnforcementPath(slug),
|
|
218
|
+
)
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Fetch profiles wearing a verified NFT from the collection as their profile picture. Page with
|
|
223
|
+
* the response's `next` passed back as `args.cursor`.
|
|
224
|
+
*/
|
|
225
|
+
async getCollectionPfpProfiles(
|
|
226
|
+
slug: string,
|
|
227
|
+
args?: GetCollectionPfpProfilesArgs,
|
|
228
|
+
): Promise<CollectionPfpProfilesResponse> {
|
|
229
|
+
return this.fetcher.get<CollectionPfpProfilesResponse>(
|
|
230
|
+
getCollectionPfpProfilesPath(slug),
|
|
231
|
+
args,
|
|
232
|
+
)
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Fetch collections ranked by how many accounts wear one of their verified NFTs as a profile
|
|
237
|
+
* picture. Omit `args.chain` to rank across every chain.
|
|
238
|
+
*/
|
|
239
|
+
async getTopPfpCollections(
|
|
240
|
+
args: GetTopPfpCollectionsArgs,
|
|
241
|
+
): Promise<TopPfpCollectionsResponse> {
|
|
242
|
+
return this.fetcher.get<TopPfpCollectionsResponse>(
|
|
243
|
+
getTopPfpCollectionsPath(),
|
|
244
|
+
args,
|
|
245
|
+
)
|
|
246
|
+
}
|
|
200
247
|
}
|
package/src/api/nfts.ts
CHANGED
|
@@ -5,8 +5,10 @@ import {
|
|
|
5
5
|
getListNFTsByAccountPath,
|
|
6
6
|
getListNFTsByCollectionPath,
|
|
7
7
|
getListNFTsByContractPath,
|
|
8
|
+
getListNFTsByGroupPath,
|
|
8
9
|
getNFTAnalyticsPath,
|
|
9
10
|
getNFTCollectionPath,
|
|
11
|
+
getNFTGroupFacetsPath,
|
|
10
12
|
getNFTMetadataPath,
|
|
11
13
|
getNFTOwnersPath,
|
|
12
14
|
getNFTPath,
|
|
@@ -19,9 +21,13 @@ import {
|
|
|
19
21
|
encodeTraitsParam,
|
|
20
22
|
type GetCollectionResponse,
|
|
21
23
|
type GetContractResponse,
|
|
24
|
+
type GetNFTGroupFacetsArgs,
|
|
25
|
+
type GetNFTGroupFacetsResponse,
|
|
22
26
|
type GetNFTMetadataResponse,
|
|
23
27
|
type GetNFTResponse,
|
|
24
28
|
type GetNFTsByAccountOptions,
|
|
29
|
+
type GetNFTsByGroupArgs,
|
|
30
|
+
type GetNFTsByGroupResponse,
|
|
25
31
|
type ListNFTsResponse,
|
|
26
32
|
type NFTOwnersArgs,
|
|
27
33
|
type NftAnalyticsResponse,
|
|
@@ -106,6 +112,37 @@ export class NFTsAPI {
|
|
|
106
112
|
return response
|
|
107
113
|
}
|
|
108
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Search NFTs across every collection in a group, such as `trading_cards`,
|
|
117
|
+
* by normalized attributes that are consistent across issuers. Facet
|
|
118
|
+
* filters match any of their values and are AND-combined with each other.
|
|
119
|
+
* Use {@link getNFTGroupFacets} to discover the values and their counts.
|
|
120
|
+
*/
|
|
121
|
+
async getNFTsByGroup(
|
|
122
|
+
group: string,
|
|
123
|
+
args: GetNFTsByGroupArgs = {},
|
|
124
|
+
): Promise<GetNFTsByGroupResponse> {
|
|
125
|
+
return this.fetcher.get<GetNFTsByGroupResponse>(
|
|
126
|
+
getListNFTsByGroupPath(group),
|
|
127
|
+
args,
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Fetch the values of each normalized attribute in a collection group with
|
|
133
|
+
* the number of matching NFTs. Each facet is narrowed by the filters of the
|
|
134
|
+
* other types, so a facet keeps listing all of its own values.
|
|
135
|
+
*/
|
|
136
|
+
async getNFTGroupFacets(
|
|
137
|
+
group: string,
|
|
138
|
+
args: GetNFTGroupFacetsArgs = {},
|
|
139
|
+
): Promise<GetNFTGroupFacetsResponse> {
|
|
140
|
+
return this.fetcher.get<GetNFTGroupFacetsResponse>(
|
|
141
|
+
getNFTGroupFacetsPath(group),
|
|
142
|
+
args,
|
|
143
|
+
)
|
|
144
|
+
}
|
|
145
|
+
|
|
109
146
|
/**
|
|
110
147
|
* Fetch metadata, traits, ownership information, and rarity for a single NFT.
|
|
111
148
|
*/
|
package/src/api/tools.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { RegisteredToolResponse } from "@opensea/api-types"
|
|
2
|
+
import { camelizeKeysDeep } from "../utils/case"
|
|
3
|
+
import {
|
|
4
|
+
getToolActivityPath,
|
|
5
|
+
getToolPath,
|
|
6
|
+
getToolsPath,
|
|
7
|
+
getToolsSearchPath,
|
|
8
|
+
getToolUsagePath,
|
|
9
|
+
} from "./apiPaths"
|
|
10
|
+
import type { Fetcher } from "./fetcher"
|
|
11
|
+
import type {
|
|
12
|
+
GetToolActivityArgs,
|
|
13
|
+
GetToolActivityResponse,
|
|
14
|
+
GetToolResponse,
|
|
15
|
+
ListToolsArgs,
|
|
16
|
+
ListToolsResponse,
|
|
17
|
+
ReportToolUsageRequest,
|
|
18
|
+
ReportToolUsageResponse,
|
|
19
|
+
SearchToolsArgs,
|
|
20
|
+
SearchToolsResponse,
|
|
21
|
+
} from "./types"
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Tool registry operations. These are the spec's "Tool Endpoints [Beta]": they are under active
|
|
25
|
+
* development and may change without notice. Saved tools are per-account and live on
|
|
26
|
+
* `api.walletAuth` (`listSavedTools`, `saveTool`, `removeSavedTool`).
|
|
27
|
+
*
|
|
28
|
+
* @beta
|
|
29
|
+
*/
|
|
30
|
+
export class ToolsAPI {
|
|
31
|
+
constructor(private fetcher: Fetcher) {}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* List verified registered tools, newest first by default.
|
|
35
|
+
* @beta
|
|
36
|
+
*/
|
|
37
|
+
async listTools(args?: ListToolsArgs): Promise<ListToolsResponse> {
|
|
38
|
+
return this.fetcher.get<ListToolsResponse>(getToolsPath(), args)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Search verified registered tools by text, tags, creator, access type, source or gating
|
|
43
|
+
* collection.
|
|
44
|
+
* @beta
|
|
45
|
+
*/
|
|
46
|
+
async searchTools(args?: SearchToolsArgs): Promise<SearchToolsResponse> {
|
|
47
|
+
return this.fetcher.get<SearchToolsResponse>(getToolsSearchPath(), args)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Get a registered tool by registry chain ID, registry address (an EVM address, or
|
|
52
|
+
* `x402_bazaar` / `x402_bankr`) and tool ID.
|
|
53
|
+
*
|
|
54
|
+
* `inputs` and `outputs` are the tool's own JSON Schemas, keyed by tool-authored property
|
|
55
|
+
* names, so they are returned as sent while the rest of the response is camelized.
|
|
56
|
+
* @beta
|
|
57
|
+
*/
|
|
58
|
+
async getTool(
|
|
59
|
+
registryChain: string | number,
|
|
60
|
+
registryAddr: string,
|
|
61
|
+
toolId: string | number,
|
|
62
|
+
): Promise<GetToolResponse> {
|
|
63
|
+
const raw = await this.fetcher.get<RegisteredToolResponse>(
|
|
64
|
+
getToolPath(registryChain, registryAddr, toolId),
|
|
65
|
+
undefined,
|
|
66
|
+
{ camelizeResponse: false },
|
|
67
|
+
)
|
|
68
|
+
const { inputs, outputs, ...fields } = raw
|
|
69
|
+
return { ...camelizeKeysDeep(fields), inputs, outputs }
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Get x402 payment events and usage reports for a registered tool, deduplicated by
|
|
74
|
+
* transaction hash. Paged by `limit` and `offset`.
|
|
75
|
+
* @beta
|
|
76
|
+
*/
|
|
77
|
+
async getToolActivity(
|
|
78
|
+
registryChain: string | number,
|
|
79
|
+
registryAddr: string,
|
|
80
|
+
toolId: string | number,
|
|
81
|
+
args?: GetToolActivityArgs,
|
|
82
|
+
): Promise<GetToolActivityResponse> {
|
|
83
|
+
return this.fetcher.get<GetToolActivityResponse>(
|
|
84
|
+
getToolActivityPath(registryChain, registryAddr, toolId),
|
|
85
|
+
args,
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Report a verified tool invocation, for metrics only. Nothing onchain happens, and the call
|
|
91
|
+
* itself does not depend on the report.
|
|
92
|
+
* @beta
|
|
93
|
+
*/
|
|
94
|
+
async reportToolUsage(
|
|
95
|
+
usage: ReportToolUsageRequest,
|
|
96
|
+
): Promise<ReportToolUsageResponse> {
|
|
97
|
+
return this.fetcher.post<ReportToolUsageResponse>(getToolUsagePath(), usage)
|
|
98
|
+
}
|
|
99
|
+
}
|
package/src/api/types.ts
CHANGED
|
@@ -4,7 +4,9 @@ import type {
|
|
|
4
4
|
AgentProfileRelationshipsResponse as ApiAgentProfileRelationshipsResponse,
|
|
5
5
|
BuildOfferResponse as ApiBuildOfferResponse,
|
|
6
6
|
CancelResponse as ApiCancelResponse,
|
|
7
|
+
CollectionPfpProfilesResponse as ApiCollectionPfpProfilesResponse,
|
|
7
8
|
CollectionSearchResponse as ApiCollectionSearchResponse,
|
|
9
|
+
CreatorFeeEnforcementStatusResponse as ApiCreatorFeeEnforcementStatusResponse,
|
|
8
10
|
DropMintRequest as ApiDropMintRequest,
|
|
9
11
|
DropMintResponse as ApiDropMintResponse,
|
|
10
12
|
Listing as ApiListing,
|
|
@@ -28,6 +30,7 @@ import type {
|
|
|
28
30
|
TokenDetailedResponse as ApiTokenDetailedResponse,
|
|
29
31
|
TokenResponse as ApiTokenResponse,
|
|
30
32
|
TokenSearchResponse as ApiTokenSearchResponse,
|
|
33
|
+
TopPfpCollectionsResponse as ApiTopPfpCollectionsResponse,
|
|
31
34
|
Trait as ApiTrait,
|
|
32
35
|
TraitFloorResponse as ApiTraitFloorResponse,
|
|
33
36
|
TraitFloorsResponse as ApiTraitFloorsResponse,
|
|
@@ -49,13 +52,23 @@ import type {
|
|
|
49
52
|
NftListResponse,
|
|
50
53
|
NftResponse,
|
|
51
54
|
OffersResponse,
|
|
55
|
+
OperationQueryParams,
|
|
52
56
|
paths,
|
|
57
|
+
RegisteredToolResponse,
|
|
58
|
+
StandardizedNft,
|
|
59
|
+
StandardizedNftFacetsResponse,
|
|
60
|
+
StandardizedNftListResponse,
|
|
53
61
|
TokenAccountActivityPaginatedResponse,
|
|
54
62
|
TokenBalancePaginatedResponse,
|
|
55
63
|
TokenBalanceResponse,
|
|
56
64
|
TokenGroupPaginatedResponse,
|
|
57
65
|
TokenGroupResponse,
|
|
58
66
|
TokenPaginatedResponse,
|
|
67
|
+
ToolActivityPaginatedResponse,
|
|
68
|
+
ToolListPaginatedResponse,
|
|
69
|
+
ToolSearchPaginatedResponse,
|
|
70
|
+
ToolUsageRequest,
|
|
71
|
+
ToolUsageResponse,
|
|
59
72
|
} from "@opensea/api-types"
|
|
60
73
|
import type { OrderType, ProtocolData } from "../orders/types"
|
|
61
74
|
import type { OpenSeaCollection } from "../types"
|
|
@@ -1305,6 +1318,44 @@ export type TraitFloor = Camelize<ApiTraitFloorResponse>
|
|
|
1305
1318
|
* @category API Response Types
|
|
1306
1319
|
*/
|
|
1307
1320
|
export type TraitFloorsResponse = Camelize<ApiTraitFloorsResponse>
|
|
1321
|
+
|
|
1322
|
+
/**
|
|
1323
|
+
* Whether a collection enforces creator fees onchain, and whether its contract supports turning
|
|
1324
|
+
* enforcement on.
|
|
1325
|
+
* @category API Response Types
|
|
1326
|
+
*/
|
|
1327
|
+
export type CreatorFeeEnforcementStatusResponse =
|
|
1328
|
+
Camelize<ApiCreatorFeeEnforcementStatusResponse>
|
|
1329
|
+
|
|
1330
|
+
/**
|
|
1331
|
+
* Query args for `GET /api/v2/collections/{slug}/pfp-profiles`, derived from the spec.
|
|
1332
|
+
* @category API Query Args
|
|
1333
|
+
*/
|
|
1334
|
+
export type GetCollectionPfpProfilesArgs = Camelize<
|
|
1335
|
+
OperationQueryParams<"get_collection_pfp_profiles">
|
|
1336
|
+
>
|
|
1337
|
+
|
|
1338
|
+
/**
|
|
1339
|
+
* Profiles wearing a verified NFT from a collection as their profile picture.
|
|
1340
|
+
* @category API Response Types
|
|
1341
|
+
*/
|
|
1342
|
+
export type CollectionPfpProfilesResponse =
|
|
1343
|
+
Camelize<ApiCollectionPfpProfilesResponse>
|
|
1344
|
+
|
|
1345
|
+
/**
|
|
1346
|
+
* Query args for `GET /api/v2/pfp/top-collections`, derived from the spec. `limit` (1-50) is
|
|
1347
|
+
* required.
|
|
1348
|
+
* @category API Query Args
|
|
1349
|
+
*/
|
|
1350
|
+
export type GetTopPfpCollectionsArgs = Camelize<
|
|
1351
|
+
OperationQueryParams<"get_top_pfp_collections">
|
|
1352
|
+
>
|
|
1353
|
+
|
|
1354
|
+
/**
|
|
1355
|
+
* Collections ranked by verified NFT profile-picture wearer count.
|
|
1356
|
+
* @category API Response Types
|
|
1357
|
+
*/
|
|
1358
|
+
export type TopPfpCollectionsResponse = Camelize<ApiTopPfpCollectionsResponse>
|
|
1308
1359
|
export type CreateOfferActionsResponse = Camelize<ApiCreateOfferActionsResponse>
|
|
1309
1360
|
export type CreateOfferFulfillmentActionsResponse =
|
|
1310
1361
|
Camelize<ApiFulfillmentActionsResponse>
|
|
@@ -1482,6 +1533,99 @@ export interface GetNFTsByAccountOptions {
|
|
|
1482
1533
|
includeAutoHidden?: boolean
|
|
1483
1534
|
}
|
|
1484
1535
|
|
|
1536
|
+
/**
|
|
1537
|
+
* Normalized-attribute filters shared by the collection group NFT search and
|
|
1538
|
+
* facets endpoints. Each value list is sent as a repeated query parameter
|
|
1539
|
+
* (`?grader=PSA&grader=CGC`) and matches any of its values; separate filters
|
|
1540
|
+
* are AND-combined. Discover the values with `getNFTGroupFacets`.
|
|
1541
|
+
*
|
|
1542
|
+
* @category API Query Args
|
|
1543
|
+
*/
|
|
1544
|
+
export interface NFTGroupFacetFilters {
|
|
1545
|
+
franchise?: string[]
|
|
1546
|
+
grader?: string[]
|
|
1547
|
+
grade?: string[]
|
|
1548
|
+
subject?: string[]
|
|
1549
|
+
year?: string[]
|
|
1550
|
+
set?: string[]
|
|
1551
|
+
language?: string[]
|
|
1552
|
+
edition?: string[]
|
|
1553
|
+
/** Serialized as `product_type`. */
|
|
1554
|
+
productType?: string[]
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
/**
|
|
1558
|
+
* Sort fields accepted by the collection group NFT search endpoint.
|
|
1559
|
+
* @category API Query Args
|
|
1560
|
+
*/
|
|
1561
|
+
export type NFTGroupSortBy =
|
|
1562
|
+
| "price"
|
|
1563
|
+
| "top_offer"
|
|
1564
|
+
| "last_sale"
|
|
1565
|
+
| "last_sale_date"
|
|
1566
|
+
| "created_date"
|
|
1567
|
+
| "received_date"
|
|
1568
|
+
| "listing_created_date"
|
|
1569
|
+
| "best_deal"
|
|
1570
|
+
| "estimated_value"
|
|
1571
|
+
|
|
1572
|
+
/**
|
|
1573
|
+
* Query args for `GET /api/v2/nfts/group/{group}`.
|
|
1574
|
+
* @category API Query Args
|
|
1575
|
+
*/
|
|
1576
|
+
export interface GetNFTsByGroupArgs extends NFTGroupFacetFilters {
|
|
1577
|
+
/** Restrict results to these collections in the group (max 10). Defaults to the whole group. */
|
|
1578
|
+
collectionSlugs?: string[]
|
|
1579
|
+
/** Full-text match on NFT name, up to 100 characters. */
|
|
1580
|
+
query?: string
|
|
1581
|
+
/** Only return NFTs that are listed (`true`) or unlisted (`false`). */
|
|
1582
|
+
isListed?: boolean
|
|
1583
|
+
/** Minimum estimated value in USD, inclusive. */
|
|
1584
|
+
minEstimatedValueUsd?: number
|
|
1585
|
+
/** Maximum estimated value in USD, inclusive. */
|
|
1586
|
+
maxEstimatedValueUsd?: number
|
|
1587
|
+
/** Sort field. The server default is `best_deal`. */
|
|
1588
|
+
sortBy?: NFTGroupSortBy
|
|
1589
|
+
/** Sort direction. The server default is `desc`. */
|
|
1590
|
+
sortDirection?: "asc" | "desc"
|
|
1591
|
+
/** Number of NFTs to return (1-100, server default 50). */
|
|
1592
|
+
limit?: number
|
|
1593
|
+
/** Pagination cursor from a previous response's `next`. */
|
|
1594
|
+
next?: string
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
/**
|
|
1598
|
+
* Query args for `GET /api/v2/nfts/group/{group}/facets`.
|
|
1599
|
+
* @category API Query Args
|
|
1600
|
+
*/
|
|
1601
|
+
export interface GetNFTGroupFacetsArgs extends NFTGroupFacetFilters {
|
|
1602
|
+
/** Only return these facet types, e.g. `["grader", "grade"]`. Defaults to all. */
|
|
1603
|
+
facetTypes?: string[]
|
|
1604
|
+
/** Restrict counts to these collections in the group (max 10). */
|
|
1605
|
+
collectionSlugs?: string[]
|
|
1606
|
+
}
|
|
1607
|
+
|
|
1608
|
+
/**
|
|
1609
|
+
* NFT with normalized, issuer-independent attributes, returned by the
|
|
1610
|
+
* collection group search. Camelized from api-types `StandardizedNft`.
|
|
1611
|
+
* @category API Models
|
|
1612
|
+
*/
|
|
1613
|
+
export type StandardizedNFT = Camelize<StandardizedNft>
|
|
1614
|
+
|
|
1615
|
+
/**
|
|
1616
|
+
* Response from the collection group NFT search.
|
|
1617
|
+
* Camelized from api-types `StandardizedNftListResponse`.
|
|
1618
|
+
* @category API Response Types
|
|
1619
|
+
*/
|
|
1620
|
+
export type GetNFTsByGroupResponse = Camelize<StandardizedNftListResponse>
|
|
1621
|
+
|
|
1622
|
+
/**
|
|
1623
|
+
* Facet values and counts for a collection group.
|
|
1624
|
+
* Camelized from api-types `StandardizedNftFacetsResponse`.
|
|
1625
|
+
* @category API Response Types
|
|
1626
|
+
*/
|
|
1627
|
+
export type GetNFTGroupFacetsResponse = Camelize<StandardizedNftFacetsResponse>
|
|
1628
|
+
|
|
1485
1629
|
/**
|
|
1486
1630
|
* Query args for the account portfolio and portfolio history endpoints.
|
|
1487
1631
|
* @category API Query Args
|
|
@@ -1575,3 +1719,68 @@ export type ProfileListingsResponse = Camelize<ListingsResponse>
|
|
|
1575
1719
|
* @category API Response Types
|
|
1576
1720
|
*/
|
|
1577
1721
|
export type ProfileOffersResponse = Camelize<OffersResponse>
|
|
1722
|
+
|
|
1723
|
+
/**
|
|
1724
|
+
* Query args for `GET /api/v2/tools`. Derived from the spec. Beta: the endpoint may change
|
|
1725
|
+
* without notice.
|
|
1726
|
+
* @category API Query Args
|
|
1727
|
+
*/
|
|
1728
|
+
export type ListToolsArgs = Camelize<OperationQueryParams<"list_tools">>
|
|
1729
|
+
|
|
1730
|
+
/**
|
|
1731
|
+
* Query args for `GET /api/v2/tools/search`. Derived from the spec. Beta: the endpoint may change
|
|
1732
|
+
* without notice.
|
|
1733
|
+
* @category API Query Args
|
|
1734
|
+
*/
|
|
1735
|
+
export type SearchToolsArgs = Camelize<OperationQueryParams<"search_tools">>
|
|
1736
|
+
|
|
1737
|
+
/**
|
|
1738
|
+
* Query args for `GET /api/v2/tools/{registry_chain}/{registry_addr}/{tool_id}/activity`.
|
|
1739
|
+
* Derived from the spec. Beta: the endpoint may change without notice.
|
|
1740
|
+
* @category API Query Args
|
|
1741
|
+
*/
|
|
1742
|
+
export type GetToolActivityArgs = Camelize<
|
|
1743
|
+
OperationQueryParams<"get_tool_activity">
|
|
1744
|
+
>
|
|
1745
|
+
|
|
1746
|
+
/**
|
|
1747
|
+
* Body for `POST /api/v2/tools/usage`. Identify the tool by `toolChainId`, `toolRegistryAddress`
|
|
1748
|
+
* and `toolOnchainId`, or by `toolEndpoint` alone. Beta: the endpoint may change without notice.
|
|
1749
|
+
* @category API Models
|
|
1750
|
+
*/
|
|
1751
|
+
export type ReportToolUsageRequest = Camelize<ToolUsageRequest>
|
|
1752
|
+
|
|
1753
|
+
/**
|
|
1754
|
+
* Response from `POST /api/v2/tools/usage`. Beta.
|
|
1755
|
+
* @category API Response Types
|
|
1756
|
+
*/
|
|
1757
|
+
export type ReportToolUsageResponse = Camelize<ToolUsageResponse>
|
|
1758
|
+
|
|
1759
|
+
/**
|
|
1760
|
+
* Response from `GET /api/v2/tools`. Beta.
|
|
1761
|
+
* @category API Response Types
|
|
1762
|
+
*/
|
|
1763
|
+
export type ListToolsResponse = Camelize<ToolListPaginatedResponse>
|
|
1764
|
+
|
|
1765
|
+
/**
|
|
1766
|
+
* Response from `GET /api/v2/tools/search`. Beta.
|
|
1767
|
+
* @category API Response Types
|
|
1768
|
+
*/
|
|
1769
|
+
export type SearchToolsResponse = Camelize<ToolSearchPaginatedResponse>
|
|
1770
|
+
|
|
1771
|
+
/**
|
|
1772
|
+
* A registered tool. `inputs` and `outputs` are the tool's own JSON Schemas and keep their
|
|
1773
|
+
* wire keys; every other field is camelized. Beta.
|
|
1774
|
+
* @category API Response Types
|
|
1775
|
+
*/
|
|
1776
|
+
export type GetToolResponse = Omit<
|
|
1777
|
+
Camelize<RegisteredToolResponse>,
|
|
1778
|
+
"inputs" | "outputs"
|
|
1779
|
+
> &
|
|
1780
|
+
Pick<RegisteredToolResponse, "inputs" | "outputs">
|
|
1781
|
+
|
|
1782
|
+
/**
|
|
1783
|
+
* Response from the tool activity endpoint. Beta.
|
|
1784
|
+
* @category API Response Types
|
|
1785
|
+
*/
|
|
1786
|
+
export type GetToolActivityResponse = Camelize<ToolActivityPaginatedResponse>
|