@opensea/sdk 9.0.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/LICENSE +7 -0
- package/README.md +70 -0
- package/lib/api/accounts.d.ts +27 -0
- package/lib/api/accounts.js +46 -0
- package/lib/api/accounts.js.map +1 -0
- package/lib/api/api.d.ts +489 -0
- package/lib/api/api.js +754 -0
- package/lib/api/api.js.map +1 -0
- package/lib/api/apiPaths.d.ts +46 -0
- package/lib/api/apiPaths.js +176 -0
- package/lib/api/apiPaths.js.map +1 -0
- package/lib/api/chains.d.ts +13 -0
- package/lib/api/chains.js +22 -0
- package/lib/api/chains.js.map +1 -0
- package/lib/api/collections.d.ts +34 -0
- package/lib/api/collections.js +80 -0
- package/lib/api/collections.js.map +1 -0
- package/lib/api/drops.d.ts +21 -0
- package/lib/api/drops.js +39 -0
- package/lib/api/drops.js.map +1 -0
- package/lib/api/events.d.ts +26 -0
- package/lib/api/events.js +43 -0
- package/lib/api/events.js.map +1 -0
- package/lib/api/fetcher.d.ts +24 -0
- package/lib/api/fetcher.js +3 -0
- package/lib/api/fetcher.js.map +1 -0
- package/lib/api/index.d.ts +2 -0
- package/lib/api/index.js +19 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/listings.d.ts +44 -0
- package/lib/api/listings.js +88 -0
- package/lib/api/listings.js.map +1 -0
- package/lib/api/nfts.d.ts +39 -0
- package/lib/api/nfts.js +79 -0
- package/lib/api/nfts.js.map +1 -0
- package/lib/api/offers.d.ts +54 -0
- package/lib/api/offers.js +124 -0
- package/lib/api/offers.js.map +1 -0
- package/lib/api/orders.d.ts +50 -0
- package/lib/api/orders.js +153 -0
- package/lib/api/orders.js.map +1 -0
- package/lib/api/search.d.ts +13 -0
- package/lib/api/search.js +22 -0
- package/lib/api/search.js.map +1 -0
- package/lib/api/tokens.d.ts +25 -0
- package/lib/api/tokens.js +43 -0
- package/lib/api/tokens.js.map +1 -0
- package/lib/api/types.d.ts +1113 -0
- package/lib/api/types.js +65 -0
- package/lib/api/types.js.map +1 -0
- package/lib/constants.d.ts +22 -0
- package/lib/constants.js +52 -0
- package/lib/constants.js.map +1 -0
- package/lib/index.d.ts +18 -0
- package/lib/index.js +24 -0
- package/lib/index.js.map +1 -0
- package/lib/orders/privateListings.d.ts +12 -0
- package/lib/orders/privateListings.js +130 -0
- package/lib/orders/privateListings.js.map +1 -0
- package/lib/orders/types.d.ts +160 -0
- package/lib/orders/types.js +10 -0
- package/lib/orders/types.js.map +1 -0
- package/lib/orders/utils.d.ts +89 -0
- package/lib/orders/utils.js +177 -0
- package/lib/orders/utils.js.map +1 -0
- package/lib/sdk/assets.d.ts +104 -0
- package/lib/sdk/assets.js +398 -0
- package/lib/sdk/assets.js.map +1 -0
- package/lib/sdk/cancellation.d.ts +97 -0
- package/lib/sdk/cancellation.js +235 -0
- package/lib/sdk/cancellation.js.map +1 -0
- package/lib/sdk/context.d.ts +28 -0
- package/lib/sdk/context.js +3 -0
- package/lib/sdk/context.js.map +1 -0
- package/lib/sdk/fulfillment.d.ts +153 -0
- package/lib/sdk/fulfillment.js +298 -0
- package/lib/sdk/fulfillment.js.map +1 -0
- package/lib/sdk/orders.d.ts +253 -0
- package/lib/sdk/orders.js +679 -0
- package/lib/sdk/orders.js.map +1 -0
- package/lib/sdk/tokens.d.ts +31 -0
- package/lib/sdk/tokens.js +65 -0
- package/lib/sdk/tokens.js.map +1 -0
- package/lib/sdk.d.ts +560 -0
- package/lib/sdk.js +693 -0
- package/lib/sdk.js.map +1 -0
- package/lib/src/api/accounts.d.ts +18 -0
- package/lib/src/api/accounts.js +30 -0
- package/lib/src/api/accounts.js.map +1 -0
- package/lib/src/api/api.d.ts +429 -0
- package/lib/src/api/api.js +652 -0
- package/lib/src/api/api.js.map +1 -0
- package/lib/src/api/apiPaths.d.ts +37 -0
- package/lib/src/api/apiPaths.js +140 -0
- package/lib/src/api/apiPaths.js.map +1 -0
- package/lib/src/api/collections.d.ts +26 -0
- package/lib/src/api/collections.js +57 -0
- package/lib/src/api/collections.js.map +1 -0
- package/lib/src/api/events.d.ts +26 -0
- package/lib/src/api/events.js +42 -0
- package/lib/src/api/events.js.map +1 -0
- package/lib/src/api/fetcher.d.ts +24 -0
- package/lib/src/api/fetcher.js +3 -0
- package/lib/src/api/fetcher.js.map +1 -0
- package/lib/src/api/index.d.ts +2 -0
- package/lib/src/api/index.js +19 -0
- package/lib/src/api/index.js.map +1 -0
- package/lib/src/api/listings.d.ts +44 -0
- package/lib/src/api/listings.js +86 -0
- package/lib/src/api/listings.js.map +1 -0
- package/lib/src/api/nfts.d.ts +35 -0
- package/lib/src/api/nfts.js +66 -0
- package/lib/src/api/nfts.js.map +1 -0
- package/lib/src/api/offers.d.ts +54 -0
- package/lib/src/api/offers.js +122 -0
- package/lib/src/api/offers.js.map +1 -0
- package/lib/src/api/orders.d.ts +50 -0
- package/lib/src/api/orders.js +151 -0
- package/lib/src/api/orders.js.map +1 -0
- package/lib/src/api/search.d.ts +13 -0
- package/lib/src/api/search.js +21 -0
- package/lib/src/api/search.js.map +1 -0
- package/lib/src/api/tokens.d.ts +25 -0
- package/lib/src/api/tokens.js +42 -0
- package/lib/src/api/tokens.js.map +1 -0
- package/lib/src/api/types.d.ts +840 -0
- package/lib/src/api/types.js +65 -0
- package/lib/src/api/types.js.map +1 -0
- package/lib/src/constants.d.ts +22 -0
- package/lib/src/constants.js +52 -0
- package/lib/src/constants.js.map +1 -0
- package/lib/src/index.d.ts +18 -0
- package/lib/src/index.js +24 -0
- package/lib/src/index.js.map +1 -0
- package/lib/src/orders/privateListings.d.ts +12 -0
- package/lib/src/orders/privateListings.js +130 -0
- package/lib/src/orders/privateListings.js.map +1 -0
- package/lib/src/orders/types.d.ts +160 -0
- package/lib/src/orders/types.js +10 -0
- package/lib/src/orders/types.js.map +1 -0
- package/lib/src/orders/utils.d.ts +89 -0
- package/lib/src/orders/utils.js +177 -0
- package/lib/src/orders/utils.js.map +1 -0
- package/lib/src/sdk/assets.d.ts +104 -0
- package/lib/src/sdk/assets.js +397 -0
- package/lib/src/sdk/assets.js.map +1 -0
- package/lib/src/sdk/cancellation.d.ts +97 -0
- package/lib/src/sdk/cancellation.js +234 -0
- package/lib/src/sdk/cancellation.js.map +1 -0
- package/lib/src/sdk/context.d.ts +28 -0
- package/lib/src/sdk/context.js +3 -0
- package/lib/src/sdk/context.js.map +1 -0
- package/lib/src/sdk/fulfillment.d.ts +153 -0
- package/lib/src/sdk/fulfillment.js +296 -0
- package/lib/src/sdk/fulfillment.js.map +1 -0
- package/lib/src/sdk/orders.d.ts +253 -0
- package/lib/src/sdk/orders.js +677 -0
- package/lib/src/sdk/orders.js.map +1 -0
- package/lib/src/sdk/tokens.d.ts +31 -0
- package/lib/src/sdk/tokens.js +64 -0
- package/lib/src/sdk/tokens.js.map +1 -0
- package/lib/src/sdk.d.ts +560 -0
- package/lib/src/sdk.js +675 -0
- package/lib/src/sdk.js.map +1 -0
- package/lib/src/typechain/contracts/ERC1155.d.ts +236 -0
- package/lib/src/typechain/contracts/ERC1155.js +3 -0
- package/lib/src/typechain/contracts/ERC1155.js.map +1 -0
- package/lib/src/typechain/contracts/ERC20.d.ts +141 -0
- package/lib/src/typechain/contracts/ERC20.js +3 -0
- package/lib/src/typechain/contracts/ERC20.js.map +1 -0
- package/lib/src/typechain/contracts/ERC721.d.ts +213 -0
- package/lib/src/typechain/contracts/ERC721.js +3 -0
- package/lib/src/typechain/contracts/ERC721.js.map +1 -0
- package/lib/src/typechain/contracts/Multicall3.d.ts +57 -0
- package/lib/src/typechain/contracts/Multicall3.js +3 -0
- package/lib/src/typechain/contracts/Multicall3.js.map +1 -0
- package/lib/src/typechain/contracts/TransferHelper.d.ts +55 -0
- package/lib/src/typechain/contracts/TransferHelper.js +3 -0
- package/lib/src/typechain/contracts/TransferHelper.js.map +1 -0
- package/lib/src/typechain/contracts/common.d.ts +50 -0
- package/lib/src/typechain/contracts/common.js +3 -0
- package/lib/src/typechain/contracts/common.js.map +1 -0
- package/lib/src/typechain/contracts/factories/ERC1155__factory.d.ts +250 -0
- package/lib/src/typechain/contracts/factories/ERC1155__factory.js +332 -0
- package/lib/src/typechain/contracts/factories/ERC1155__factory.js.map +1 -0
- package/lib/src/typechain/contracts/factories/ERC20__factory.d.ts +174 -0
- package/lib/src/typechain/contracts/factories/ERC20__factory.js +240 -0
- package/lib/src/typechain/contracts/factories/ERC20__factory.js.map +1 -0
- package/lib/src/typechain/contracts/factories/ERC721__factory.d.ts +268 -0
- package/lib/src/typechain/contracts/factories/ERC721__factory.js +351 -0
- package/lib/src/typechain/contracts/factories/ERC721__factory.js.map +1 -0
- package/lib/src/typechain/contracts/factories/Multicall3__factory.d.ts +43 -0
- package/lib/src/typechain/contracts/factories/Multicall3__factory.js +68 -0
- package/lib/src/typechain/contracts/factories/Multicall3__factory.js.map +1 -0
- package/lib/src/typechain/contracts/factories/TransferHelper__factory.d.ts +46 -0
- package/lib/src/typechain/contracts/factories/TransferHelper__factory.js +71 -0
- package/lib/src/typechain/contracts/factories/TransferHelper__factory.js.map +1 -0
- package/lib/src/typechain/contracts/factories/index.d.ts +5 -0
- package/lib/src/typechain/contracts/factories/index.js +17 -0
- package/lib/src/typechain/contracts/factories/index.js.map +1 -0
- package/lib/src/typechain/contracts/index.d.ts +11 -0
- package/lib/src/typechain/contracts/index.js +48 -0
- package/lib/src/typechain/contracts/index.js.map +1 -0
- package/lib/src/types.d.ts +387 -0
- package/lib/src/types.js +127 -0
- package/lib/src/types.js.map +1 -0
- package/lib/src/utils/chain.d.ts +60 -0
- package/lib/src/utils/chain.js +248 -0
- package/lib/src/utils/chain.js.map +1 -0
- package/lib/src/utils/converters.d.ts +37 -0
- package/lib/src/utils/converters.js +137 -0
- package/lib/src/utils/converters.js.map +1 -0
- package/lib/src/utils/dateHelper.d.ts +38 -0
- package/lib/src/utils/dateHelper.js +52 -0
- package/lib/src/utils/dateHelper.js.map +1 -0
- package/lib/src/utils/fees.d.ts +13 -0
- package/lib/src/utils/fees.js +29 -0
- package/lib/src/utils/fees.js.map +1 -0
- package/lib/src/utils/index.d.ts +2 -0
- package/lib/src/utils/index.js +19 -0
- package/lib/src/utils/index.js.map +1 -0
- package/lib/src/utils/protocol.d.ts +75 -0
- package/lib/src/utils/protocol.js +161 -0
- package/lib/src/utils/protocol.js.map +1 -0
- package/lib/src/utils/rateLimit.d.ts +34 -0
- package/lib/src/utils/rateLimit.js +97 -0
- package/lib/src/utils/rateLimit.js.map +1 -0
- package/lib/src/utils/stringHelper.d.ts +18 -0
- package/lib/src/utils/stringHelper.js +24 -0
- package/lib/src/utils/stringHelper.js.map +1 -0
- package/lib/src/utils/utils.d.ts +18 -0
- package/lib/src/utils/utils.js +45 -0
- package/lib/src/utils/utils.js.map +1 -0
- package/lib/typechain/contracts/ERC1155.d.ts +236 -0
- package/lib/typechain/contracts/ERC1155.js +3 -0
- package/lib/typechain/contracts/ERC1155.js.map +1 -0
- package/lib/typechain/contracts/ERC20.d.ts +141 -0
- package/lib/typechain/contracts/ERC20.js +3 -0
- package/lib/typechain/contracts/ERC20.js.map +1 -0
- package/lib/typechain/contracts/ERC721.d.ts +213 -0
- package/lib/typechain/contracts/ERC721.js +3 -0
- package/lib/typechain/contracts/ERC721.js.map +1 -0
- package/lib/typechain/contracts/Multicall3.d.ts +57 -0
- package/lib/typechain/contracts/Multicall3.js +3 -0
- package/lib/typechain/contracts/Multicall3.js.map +1 -0
- package/lib/typechain/contracts/TransferHelper.d.ts +55 -0
- package/lib/typechain/contracts/TransferHelper.js +3 -0
- package/lib/typechain/contracts/TransferHelper.js.map +1 -0
- package/lib/typechain/contracts/common.d.ts +50 -0
- package/lib/typechain/contracts/common.js +3 -0
- package/lib/typechain/contracts/common.js.map +1 -0
- package/lib/typechain/contracts/factories/ERC1155__factory.d.ts +250 -0
- package/lib/typechain/contracts/factories/ERC1155__factory.js +332 -0
- package/lib/typechain/contracts/factories/ERC1155__factory.js.map +1 -0
- package/lib/typechain/contracts/factories/ERC20__factory.d.ts +174 -0
- package/lib/typechain/contracts/factories/ERC20__factory.js +240 -0
- package/lib/typechain/contracts/factories/ERC20__factory.js.map +1 -0
- package/lib/typechain/contracts/factories/ERC721__factory.d.ts +268 -0
- package/lib/typechain/contracts/factories/ERC721__factory.js +351 -0
- package/lib/typechain/contracts/factories/ERC721__factory.js.map +1 -0
- package/lib/typechain/contracts/factories/Multicall3__factory.d.ts +43 -0
- package/lib/typechain/contracts/factories/Multicall3__factory.js +68 -0
- package/lib/typechain/contracts/factories/Multicall3__factory.js.map +1 -0
- package/lib/typechain/contracts/factories/TransferHelper__factory.d.ts +46 -0
- package/lib/typechain/contracts/factories/TransferHelper__factory.js +71 -0
- package/lib/typechain/contracts/factories/TransferHelper__factory.js.map +1 -0
- package/lib/typechain/contracts/factories/index.d.ts +5 -0
- package/lib/typechain/contracts/factories/index.js +17 -0
- package/lib/typechain/contracts/factories/index.js.map +1 -0
- package/lib/typechain/contracts/index.d.ts +11 -0
- package/lib/typechain/contracts/index.js +48 -0
- package/lib/typechain/contracts/index.js.map +1 -0
- package/lib/types.d.ts +389 -0
- package/lib/types.js +129 -0
- package/lib/types.js.map +1 -0
- package/lib/utils/chain.d.ts +64 -0
- package/lib/utils/chain.js +211 -0
- package/lib/utils/chain.js.map +1 -0
- package/lib/utils/chainIds.generated.d.ts +7 -0
- package/lib/utils/chainIds.generated.js +37 -0
- package/lib/utils/chainIds.generated.js.map +1 -0
- package/lib/utils/converters.d.ts +37 -0
- package/lib/utils/converters.js +137 -0
- package/lib/utils/converters.js.map +1 -0
- package/lib/utils/dateHelper.d.ts +38 -0
- package/lib/utils/dateHelper.js +52 -0
- package/lib/utils/dateHelper.js.map +1 -0
- package/lib/utils/fees.d.ts +13 -0
- package/lib/utils/fees.js +29 -0
- package/lib/utils/fees.js.map +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +19 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/protocol.d.ts +75 -0
- package/lib/utils/protocol.js +161 -0
- package/lib/utils/protocol.js.map +1 -0
- package/lib/utils/rateLimit.d.ts +34 -0
- package/lib/utils/rateLimit.js +97 -0
- package/lib/utils/rateLimit.js.map +1 -0
- package/lib/utils/stringHelper.d.ts +18 -0
- package/lib/utils/stringHelper.js +24 -0
- package/lib/utils/stringHelper.js.map +1 -0
- package/lib/utils/utils.d.ts +18 -0
- package/lib/utils/utils.js +45 -0
- package/lib/utils/utils.js.map +1 -0
- package/package.json +72 -0
- package/src/abi/ERC1155.json +314 -0
- package/src/abi/ERC20.json +222 -0
- package/src/abi/ERC721.json +333 -0
- package/src/abi/Multicall3.json +50 -0
- package/src/abi/TransferHelper.json +53 -0
- package/src/api/accounts.ts +69 -0
- package/src/api/api.ts +1152 -0
- package/src/api/apiPaths.ts +208 -0
- package/src/api/chains.ts +18 -0
- package/src/api/collections.ts +120 -0
- package/src/api/drops.ts +49 -0
- package/src/api/events.ts +71 -0
- package/src/api/fetcher.ts +31 -0
- package/src/api/index.ts +2 -0
- package/src/api/listings.ts +126 -0
- package/src/api/nfts.ts +144 -0
- package/src/api/offers.ts +242 -0
- package/src/api/orders.ts +283 -0
- package/src/api/search.ts +21 -0
- package/src/api/tokens.ts +67 -0
- package/src/api/types.ts +1210 -0
- package/src/constants.ts +90 -0
- package/src/index.ts +22 -0
- package/src/orders/privateListings.ts +173 -0
- package/src/orders/types.ts +191 -0
- package/src/orders/utils.ts +253 -0
- package/src/sdk/assets.ts +591 -0
- package/src/sdk/cancellation.ts +346 -0
- package/src/sdk/context.ts +33 -0
- package/src/sdk/fulfillment.ts +478 -0
- package/src/sdk/orders.ts +1149 -0
- package/src/sdk/tokens.ts +95 -0
- package/src/sdk.ts +1051 -0
- package/src/typechain/contracts/ERC1155.ts +440 -0
- package/src/typechain/contracts/ERC20.ts +286 -0
- package/src/typechain/contracts/ERC721.ts +412 -0
- package/src/typechain/contracts/Multicall3.ts +117 -0
- package/src/typechain/contracts/TransferHelper.ts +122 -0
- package/src/typechain/contracts/common.ts +131 -0
- package/src/typechain/contracts/factories/ERC1155__factory.ts +331 -0
- package/src/typechain/contracts/factories/ERC20__factory.ts +239 -0
- package/src/typechain/contracts/factories/ERC721__factory.ts +350 -0
- package/src/typechain/contracts/factories/Multicall3__factory.ts +67 -0
- package/src/typechain/contracts/factories/TransferHelper__factory.ts +76 -0
- package/src/typechain/contracts/factories/index.ts +8 -0
- package/src/typechain/contracts/index.ts +14 -0
- package/src/types.ts +413 -0
- package/src/utils/chain.ts +224 -0
- package/src/utils/chainIds.generated.ts +34 -0
- package/src/utils/converters.ts +145 -0
- package/src/utils/dateHelper.ts +48 -0
- package/src/utils/fees.ts +31 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/protocol.ts +185 -0
- package/src/utils/rateLimit.ts +147 -0
- package/src/utils/stringHelper.ts +25 -0
- package/src/utils/utils.ts +36 -0
package/src/api/types.ts
ADDED
|
@@ -0,0 +1,1210 @@
|
|
|
1
|
+
import type { ConsiderationItem } from "@opensea/seaport-js/lib/types"
|
|
2
|
+
import type {
|
|
3
|
+
OrderType,
|
|
4
|
+
OrderV2,
|
|
5
|
+
ProtocolData,
|
|
6
|
+
QueryCursors,
|
|
7
|
+
} from "../orders/types"
|
|
8
|
+
import type { OpenSeaCollection } from "../types"
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Response from OpenSea API for building an offer.
|
|
12
|
+
* @category API Response Types
|
|
13
|
+
*/
|
|
14
|
+
export type BuildOfferResponse = {
|
|
15
|
+
/** A portion of the parameters needed to submit a criteria offer, i.e. collection offer. */
|
|
16
|
+
partialParameters: PartialParameters
|
|
17
|
+
/** Criteria echoed back from the build request. Includes collection and trait info. */
|
|
18
|
+
criteria: BuildOfferCriteria
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Criteria returned by the build offer endpoint.
|
|
23
|
+
* Subset of {@link Criteria} — only collection and trait fields.
|
|
24
|
+
* @category API Response Types
|
|
25
|
+
*/
|
|
26
|
+
export type BuildOfferCriteria = {
|
|
27
|
+
collection: CollectionCriteria
|
|
28
|
+
traits?: TraitCriteria[]
|
|
29
|
+
numericTraits?: NumericTraitCriteria[]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type PartialParameters = {
|
|
33
|
+
consideration: ConsiderationItem[]
|
|
34
|
+
zone: string
|
|
35
|
+
zoneHash: string
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Criteria for collection or trait offers.
|
|
40
|
+
* @category API Response Types
|
|
41
|
+
*/
|
|
42
|
+
type Criteria = {
|
|
43
|
+
/** The collection for the criteria */
|
|
44
|
+
collection: CollectionCriteria
|
|
45
|
+
/** The contract for the criteria */
|
|
46
|
+
contract: ContractCriteria
|
|
47
|
+
/** Represents a list of token ids which can be used to fulfill the criteria offer. */
|
|
48
|
+
encoded_token_ids?: string
|
|
49
|
+
/** The trait for the criteria (single trait) */
|
|
50
|
+
trait?: TraitCriteria
|
|
51
|
+
/** Multiple traits for the criteria (multi-trait offers) */
|
|
52
|
+
traits?: TraitCriteria[]
|
|
53
|
+
/** Numeric traits for the criteria (numeric trait offers) */
|
|
54
|
+
numericTraits?: NumericTraitCriteria[]
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Criteria for trait offers.
|
|
59
|
+
* @category API Response Types
|
|
60
|
+
*/
|
|
61
|
+
type TraitCriteria = {
|
|
62
|
+
type: string
|
|
63
|
+
value: string
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Criteria for numeric trait offers.
|
|
68
|
+
* At least one of min or max must be defined.
|
|
69
|
+
* @category API Response Types
|
|
70
|
+
*/
|
|
71
|
+
type NumericTraitCriteria = {
|
|
72
|
+
type: string
|
|
73
|
+
min?: number
|
|
74
|
+
max?: number
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
type CollectionCriteria = {
|
|
78
|
+
slug: string
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
type ContractCriteria = {
|
|
82
|
+
address: string
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Query args for Get Collections
|
|
87
|
+
* @category API Query Args
|
|
88
|
+
*/
|
|
89
|
+
export interface GetCollectionsArgs {
|
|
90
|
+
order_by?: string
|
|
91
|
+
limit?: number
|
|
92
|
+
next?: string
|
|
93
|
+
chain?: string
|
|
94
|
+
creator_username?: string
|
|
95
|
+
include_hidden?: boolean
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Response from OpenSea API for fetching a single collection.
|
|
100
|
+
* @category API Response Types
|
|
101
|
+
*/
|
|
102
|
+
export type GetCollectionResponse = {
|
|
103
|
+
/** Collection object. See {@link OpenSeaCollection} */
|
|
104
|
+
collection: OpenSeaCollection
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Response from OpenSea API for fetching a list of collections.
|
|
109
|
+
* @category API Response Types
|
|
110
|
+
*/
|
|
111
|
+
export type GetCollectionsResponse = QueryCursorsV2 & {
|
|
112
|
+
/** List of collections. See {@link OpenSeaCollection} */
|
|
113
|
+
collections: OpenSeaCollection[]
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export enum CollectionOrderByOption {
|
|
117
|
+
CREATED_DATE = "created_date",
|
|
118
|
+
ONE_DAY_CHANGE = "one_day_change",
|
|
119
|
+
SEVEN_DAY_VOLUME = "seven_day_volume",
|
|
120
|
+
SEVEN_DAY_CHANGE = "seven_day_change",
|
|
121
|
+
NUM_OWNERS = "num_owners",
|
|
122
|
+
MARKET_CAP = "market_cap",
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Order status enum.
|
|
127
|
+
* @category API Models
|
|
128
|
+
*/
|
|
129
|
+
export enum OrderStatus {
|
|
130
|
+
ACTIVE = "ACTIVE",
|
|
131
|
+
INACTIVE = "INACTIVE",
|
|
132
|
+
FULFILLED = "FULFILLED",
|
|
133
|
+
EXPIRED = "EXPIRED",
|
|
134
|
+
CANCELLED = "CANCELLED",
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Base Order type shared between Listings and Offers.
|
|
139
|
+
* @category API Models
|
|
140
|
+
*/
|
|
141
|
+
export type Order = {
|
|
142
|
+
/** Offer Identifier */
|
|
143
|
+
order_hash: string
|
|
144
|
+
/** Chain the offer exists on */
|
|
145
|
+
chain: string
|
|
146
|
+
/** The protocol data for the order. Only 'seaport' is currently supported. */
|
|
147
|
+
protocol_data: ProtocolData
|
|
148
|
+
/** The contract address of the protocol. */
|
|
149
|
+
protocol_address: string
|
|
150
|
+
/** The price of the order. */
|
|
151
|
+
price: Price
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Offer type.
|
|
156
|
+
* @category API Models
|
|
157
|
+
*/
|
|
158
|
+
export type Offer = Order & {
|
|
159
|
+
/** The criteria for the offer if it is a collection or trait offer. */
|
|
160
|
+
criteria?: Criteria
|
|
161
|
+
/** The status of the offer. */
|
|
162
|
+
status: OrderStatus
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Collection Offer type.
|
|
167
|
+
* @category API Models
|
|
168
|
+
*/
|
|
169
|
+
export type CollectionOffer = Required<Pick<Offer, "criteria">> & Offer
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Price response.
|
|
173
|
+
* @category API Models
|
|
174
|
+
*/
|
|
175
|
+
export type Price = {
|
|
176
|
+
currency: string
|
|
177
|
+
decimals: number
|
|
178
|
+
value: string
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Listing order type.
|
|
183
|
+
* @category API Models
|
|
184
|
+
*/
|
|
185
|
+
export type Listing = Omit<Order, "price"> & {
|
|
186
|
+
/** The order type of the listing. */
|
|
187
|
+
type: OrderType
|
|
188
|
+
/** The price of the listing with current price nested. */
|
|
189
|
+
price: {
|
|
190
|
+
current: Price
|
|
191
|
+
}
|
|
192
|
+
/** The remaining quantity available for the listing. This is important for partially filled orders. */
|
|
193
|
+
remaining_quantity: number
|
|
194
|
+
/** The status of the listing. */
|
|
195
|
+
status: OrderStatus
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Response from OpenSea API for fetching a list of collection offers.
|
|
200
|
+
* @category API Response Types
|
|
201
|
+
*/
|
|
202
|
+
export type ListCollectionOffersResponse = {
|
|
203
|
+
/** List of {@link Offer} */
|
|
204
|
+
offers: CollectionOffer[]
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Response from OpenSea API for fetching a list of NFTs.
|
|
209
|
+
* @category API Response Types
|
|
210
|
+
*/
|
|
211
|
+
export type ListNFTsResponse = {
|
|
212
|
+
/** List of {@link NFT} */
|
|
213
|
+
nfts: NFT[]
|
|
214
|
+
/** Cursor for next page of results. */
|
|
215
|
+
next: string
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Response from OpenSea API for fetching a single NFT.
|
|
220
|
+
* @category API Response Types
|
|
221
|
+
*/
|
|
222
|
+
export type GetNFTResponse = {
|
|
223
|
+
/** See {@link NFT} */
|
|
224
|
+
nft: NFT
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Response from OpenSea API for fetching Orders.
|
|
229
|
+
* @category API Response Types
|
|
230
|
+
*/
|
|
231
|
+
export type GetOrdersResponse = QueryCursors & {
|
|
232
|
+
/** List of {@link OrderV2} */
|
|
233
|
+
orders: OrderV2[]
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Base query cursors response from OpenSea API.
|
|
238
|
+
* @category API Response Types
|
|
239
|
+
*/
|
|
240
|
+
export type QueryCursorsV2 = {
|
|
241
|
+
next?: string
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Response from OpenSea API for fetching offers.
|
|
246
|
+
* @category API Response Types
|
|
247
|
+
*/
|
|
248
|
+
export type GetOffersResponse = QueryCursorsV2 & {
|
|
249
|
+
offers: Offer[]
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Response from OpenSea API for fetching listings.
|
|
254
|
+
* @category API Response Types
|
|
255
|
+
*/
|
|
256
|
+
export type GetListingsResponse = QueryCursorsV2 & {
|
|
257
|
+
listings: Listing[]
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Response from OpenSea API for fetching a best offer.
|
|
262
|
+
* @category API Response Types
|
|
263
|
+
*/
|
|
264
|
+
export type GetBestOfferResponse = Offer | CollectionOffer
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Response from OpenSea API for fetching a best listing.
|
|
268
|
+
* @category API Response Types
|
|
269
|
+
*/
|
|
270
|
+
export type GetBestListingResponse = Listing
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Response from OpenSea API for fetching an order by hash.
|
|
274
|
+
* Can be either an Offer or a Listing.
|
|
275
|
+
* @category API Response Types
|
|
276
|
+
*/
|
|
277
|
+
export type GetOrderByHashResponse = Offer | Listing
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Response from OpenSea API for offchain canceling an order.
|
|
281
|
+
* @category API Response Types
|
|
282
|
+
*/
|
|
283
|
+
export type CancelOrderResponse = {
|
|
284
|
+
last_signature_issued_valid_until: string | null
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* NFT type returned by OpenSea API.
|
|
289
|
+
* @category API Models
|
|
290
|
+
*/
|
|
291
|
+
export type NFT = {
|
|
292
|
+
/** NFT Identifier (also commonly referred to as tokenId) */
|
|
293
|
+
identifier: string
|
|
294
|
+
/** Slug identifier of collection */
|
|
295
|
+
collection: string
|
|
296
|
+
/** Address of contract */
|
|
297
|
+
contract: string
|
|
298
|
+
/** Token standard, i.e. ERC721, ERC1155, etc. */
|
|
299
|
+
token_standard: string
|
|
300
|
+
/** Name of NFT */
|
|
301
|
+
name: string
|
|
302
|
+
/** Description of NFT */
|
|
303
|
+
description: string
|
|
304
|
+
/** URL of image */
|
|
305
|
+
image_url: string
|
|
306
|
+
/** URL of metadata */
|
|
307
|
+
metadata_url: string
|
|
308
|
+
/** URL on OpenSea */
|
|
309
|
+
opensea_url: string
|
|
310
|
+
/** Date of latest NFT update */
|
|
311
|
+
updated_at: string
|
|
312
|
+
/** Whether NFT is disabled for trading on OpenSea */
|
|
313
|
+
is_disabled: boolean
|
|
314
|
+
/** Whether NFT is NSFW (Not Safe For Work) */
|
|
315
|
+
is_nsfw: boolean
|
|
316
|
+
/** Traits for the NFT, returns null if the NFT has than 50 traits */
|
|
317
|
+
traits: Trait[] | null
|
|
318
|
+
/** Creator of the NFT */
|
|
319
|
+
creator: string
|
|
320
|
+
/** Owners of the NFT */
|
|
321
|
+
owners: {
|
|
322
|
+
address: string
|
|
323
|
+
quantity: number
|
|
324
|
+
}[]
|
|
325
|
+
/** Rarity of the NFT */
|
|
326
|
+
rarity: null | {
|
|
327
|
+
strategy_id: string | null
|
|
328
|
+
strategy_version: string | null
|
|
329
|
+
rank: number | null
|
|
330
|
+
score: number | null
|
|
331
|
+
calculated_at: string
|
|
332
|
+
max_rank: number | null
|
|
333
|
+
tokens_scored: number | null
|
|
334
|
+
ranking_features: null | {
|
|
335
|
+
unique_attribute_count: number
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Trait type returned by OpenSea API.
|
|
342
|
+
* @category API Models
|
|
343
|
+
*/
|
|
344
|
+
export type Trait = {
|
|
345
|
+
/** The name of the trait category (e.g. 'Background') */
|
|
346
|
+
trait_type: string
|
|
347
|
+
/** A field indicating how to display. None is used for string traits. */
|
|
348
|
+
display_type: TraitDisplayType
|
|
349
|
+
/** Ceiling for possible numeric trait values */
|
|
350
|
+
max_value: string
|
|
351
|
+
/** The value of the trait (e.g. 'Red') */
|
|
352
|
+
value: string | number | Date
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Trait display type returned by OpenSea API.
|
|
357
|
+
* @category API Models
|
|
358
|
+
*/
|
|
359
|
+
export enum TraitDisplayType {
|
|
360
|
+
NUMBER = "number",
|
|
361
|
+
BOOST_PERCENTAGE = "boost_percentage",
|
|
362
|
+
BOOST_NUMBER = "boost_number",
|
|
363
|
+
AUTHOR = "author",
|
|
364
|
+
DATE = "date",
|
|
365
|
+
/** "None" is used for string traits */
|
|
366
|
+
NONE = "None",
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* Asset event type returned by OpenSea API.
|
|
371
|
+
* @category API Models
|
|
372
|
+
*/
|
|
373
|
+
export enum AssetEventType {
|
|
374
|
+
SALE = "sale",
|
|
375
|
+
TRANSFER = "transfer",
|
|
376
|
+
MINT = "mint",
|
|
377
|
+
LISTING = "listing",
|
|
378
|
+
ORDER = "order",
|
|
379
|
+
OFFER = "offer",
|
|
380
|
+
TRAIT_OFFER = "trait_offer",
|
|
381
|
+
COLLECTION_OFFER = "collection_offer",
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Order type for order events.
|
|
386
|
+
* @category API Models
|
|
387
|
+
*/
|
|
388
|
+
export enum OrderEventType {
|
|
389
|
+
LISTING = "listing",
|
|
390
|
+
ITEM_OFFER = "item_offer",
|
|
391
|
+
COLLECTION_OFFER = "collection_offer",
|
|
392
|
+
TRAIT_OFFER = "trait_offer",
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Payment information for an event.
|
|
397
|
+
* @category API Models
|
|
398
|
+
*/
|
|
399
|
+
export type EventPayment = {
|
|
400
|
+
/** Quantity of the payment token */
|
|
401
|
+
quantity: string
|
|
402
|
+
/** Address of the payment token (0x0...0 for ETH) */
|
|
403
|
+
token_address: string
|
|
404
|
+
/** Decimals of the payment token */
|
|
405
|
+
decimals: number
|
|
406
|
+
/** Symbol of the payment token */
|
|
407
|
+
symbol: string
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Asset information in an event.
|
|
412
|
+
* @category API Models
|
|
413
|
+
*/
|
|
414
|
+
export type EventAsset = {
|
|
415
|
+
identifier: string
|
|
416
|
+
collection: string
|
|
417
|
+
contract: string
|
|
418
|
+
token_standard: string
|
|
419
|
+
name: string
|
|
420
|
+
description: string
|
|
421
|
+
image_url: string
|
|
422
|
+
display_image_url: string
|
|
423
|
+
display_animation_url: string | null
|
|
424
|
+
metadata_url: string
|
|
425
|
+
opensea_url: string
|
|
426
|
+
updated_at: string
|
|
427
|
+
is_disabled: boolean
|
|
428
|
+
is_nsfw: boolean
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Base event type.
|
|
433
|
+
* @category API Models
|
|
434
|
+
*/
|
|
435
|
+
type BaseEvent = {
|
|
436
|
+
/** Type of the event */
|
|
437
|
+
event_type: AssetEventType | string
|
|
438
|
+
/** Timestamp of the event */
|
|
439
|
+
event_timestamp: number
|
|
440
|
+
/** Chain the event occurred on */
|
|
441
|
+
chain: string
|
|
442
|
+
/** Quantity involved in the event */
|
|
443
|
+
quantity: number
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Listing event type.
|
|
448
|
+
* @category API Models
|
|
449
|
+
*/
|
|
450
|
+
export type ListingEvent = BaseEvent & {
|
|
451
|
+
event_type: AssetEventType.LISTING | "listing"
|
|
452
|
+
/** Payment information */
|
|
453
|
+
payment: EventPayment
|
|
454
|
+
/** Start date of the listing */
|
|
455
|
+
start_date: number | null
|
|
456
|
+
/** Expiration date of the listing */
|
|
457
|
+
expiration_date: number
|
|
458
|
+
/** Asset involved in the listing */
|
|
459
|
+
asset: EventAsset
|
|
460
|
+
/** Maker of the listing */
|
|
461
|
+
maker: string
|
|
462
|
+
/** Taker of the listing */
|
|
463
|
+
taker: string
|
|
464
|
+
/** Whether the listing is private */
|
|
465
|
+
is_private_listing: boolean
|
|
466
|
+
/** Order hash (optional) */
|
|
467
|
+
order_hash?: string
|
|
468
|
+
/** Protocol address (optional) */
|
|
469
|
+
protocol_address?: string
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Offer event type.
|
|
474
|
+
* @category API Models
|
|
475
|
+
*/
|
|
476
|
+
export type OfferEvent = BaseEvent & {
|
|
477
|
+
event_type: AssetEventType.OFFER | "offer"
|
|
478
|
+
/** Payment information */
|
|
479
|
+
payment: EventPayment
|
|
480
|
+
/** Start date of the offer */
|
|
481
|
+
start_date: number | null
|
|
482
|
+
/** Expiration date of the offer */
|
|
483
|
+
expiration_date: number
|
|
484
|
+
/** Asset involved in the offer */
|
|
485
|
+
asset: EventAsset
|
|
486
|
+
/** Maker of the offer */
|
|
487
|
+
maker: string
|
|
488
|
+
/** Taker of the offer */
|
|
489
|
+
taker: string
|
|
490
|
+
/** Order hash (optional) */
|
|
491
|
+
order_hash?: string
|
|
492
|
+
/** Protocol address (optional) */
|
|
493
|
+
protocol_address?: string
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Trait offer event type.
|
|
498
|
+
* @category API Models
|
|
499
|
+
*/
|
|
500
|
+
export type TraitOfferEvent = BaseEvent & {
|
|
501
|
+
event_type: AssetEventType.TRAIT_OFFER | "trait_offer"
|
|
502
|
+
/** Payment information */
|
|
503
|
+
payment: EventPayment
|
|
504
|
+
/** Start date of the offer */
|
|
505
|
+
start_date: number | null
|
|
506
|
+
/** Expiration date of the offer */
|
|
507
|
+
expiration_date: number
|
|
508
|
+
/** Criteria for trait offers */
|
|
509
|
+
criteria: Record<string, unknown>
|
|
510
|
+
/** Maker of the offer */
|
|
511
|
+
maker: string
|
|
512
|
+
/** Taker of the offer */
|
|
513
|
+
taker: string
|
|
514
|
+
/** Order hash (optional) */
|
|
515
|
+
order_hash?: string
|
|
516
|
+
/** Protocol address (optional) */
|
|
517
|
+
protocol_address?: string
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Collection offer event type.
|
|
522
|
+
* @category API Models
|
|
523
|
+
*/
|
|
524
|
+
export type CollectionOfferEvent = BaseEvent & {
|
|
525
|
+
event_type: AssetEventType.COLLECTION_OFFER | "collection_offer"
|
|
526
|
+
/** Payment information */
|
|
527
|
+
payment: EventPayment
|
|
528
|
+
/** Start date of the offer */
|
|
529
|
+
start_date: number | null
|
|
530
|
+
/** Expiration date of the offer */
|
|
531
|
+
expiration_date: number
|
|
532
|
+
/** Criteria for collection offers */
|
|
533
|
+
criteria: Record<string, unknown>
|
|
534
|
+
/** Maker of the offer */
|
|
535
|
+
maker: string
|
|
536
|
+
/** Taker of the offer */
|
|
537
|
+
taker: string
|
|
538
|
+
/** Order hash (optional) */
|
|
539
|
+
order_hash?: string
|
|
540
|
+
/** Protocol address (optional) */
|
|
541
|
+
protocol_address?: string
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Order event type returned by the API for order-related activities
|
|
546
|
+
* (listings, offers, trait offers, collection offers).
|
|
547
|
+
* @category API Models
|
|
548
|
+
*/
|
|
549
|
+
export type OrderEvent = BaseEvent & {
|
|
550
|
+
event_type: AssetEventType.ORDER | "order"
|
|
551
|
+
/** Payment information */
|
|
552
|
+
payment: EventPayment
|
|
553
|
+
/** Start date of the order */
|
|
554
|
+
start_date: number | null
|
|
555
|
+
/** Expiration date of the order */
|
|
556
|
+
expiration_date: number
|
|
557
|
+
/** Asset involved in the order (optional, not present for collection/trait offers) */
|
|
558
|
+
asset?: EventAsset
|
|
559
|
+
/** Criteria for collection/trait offers (optional) */
|
|
560
|
+
criteria?: Record<string, unknown>
|
|
561
|
+
/** Maker of the order */
|
|
562
|
+
maker: string
|
|
563
|
+
/** Taker of the order */
|
|
564
|
+
taker: string
|
|
565
|
+
/** Order hash (optional) */
|
|
566
|
+
order_hash?: string
|
|
567
|
+
/** Protocol address (optional) */
|
|
568
|
+
protocol_address?: string
|
|
569
|
+
/** Order type providing more detail */
|
|
570
|
+
order_type?: OrderEventType
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Mint event type.
|
|
575
|
+
* @category API Models
|
|
576
|
+
*/
|
|
577
|
+
export type MintEvent = BaseEvent & {
|
|
578
|
+
event_type: AssetEventType.MINT | "mint"
|
|
579
|
+
/** Transaction hash */
|
|
580
|
+
transaction: string
|
|
581
|
+
/** Address the NFT was minted to */
|
|
582
|
+
to_address: string
|
|
583
|
+
/** NFT that was minted */
|
|
584
|
+
nft: EventAsset
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* Sale event type.
|
|
589
|
+
* @category API Models
|
|
590
|
+
*/
|
|
591
|
+
export type SaleEvent = BaseEvent & {
|
|
592
|
+
event_type: AssetEventType.SALE | "sale"
|
|
593
|
+
/** Transaction hash */
|
|
594
|
+
transaction: string
|
|
595
|
+
/** Order hash */
|
|
596
|
+
order_hash: string
|
|
597
|
+
/** Protocol address */
|
|
598
|
+
protocol_address: string
|
|
599
|
+
/** Payment information */
|
|
600
|
+
payment: EventPayment
|
|
601
|
+
/** Closing date of the sale */
|
|
602
|
+
closing_date: number
|
|
603
|
+
/** Seller address */
|
|
604
|
+
seller: string
|
|
605
|
+
/** Buyer address */
|
|
606
|
+
buyer: string
|
|
607
|
+
/** NFT involved in the sale */
|
|
608
|
+
nft: EventAsset
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Transfer event type.
|
|
613
|
+
* @category API Models
|
|
614
|
+
*/
|
|
615
|
+
export type TransferEvent = BaseEvent & {
|
|
616
|
+
event_type: AssetEventType.TRANSFER | "transfer"
|
|
617
|
+
/** Transaction hash */
|
|
618
|
+
transaction: string
|
|
619
|
+
/** Address the NFT was transferred from */
|
|
620
|
+
from_address: string
|
|
621
|
+
/** Address the NFT was transferred to */
|
|
622
|
+
to_address: string
|
|
623
|
+
/** NFT involved in the transfer */
|
|
624
|
+
nft: EventAsset
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* Generic event type that can be any event type.
|
|
629
|
+
* @category API Models
|
|
630
|
+
*/
|
|
631
|
+
export type AssetEvent =
|
|
632
|
+
| ListingEvent
|
|
633
|
+
| OfferEvent
|
|
634
|
+
| TraitOfferEvent
|
|
635
|
+
| CollectionOfferEvent
|
|
636
|
+
| OrderEvent
|
|
637
|
+
| SaleEvent
|
|
638
|
+
| TransferEvent
|
|
639
|
+
| MintEvent
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* Query args for Get Events endpoints.
|
|
643
|
+
* @category API Query Args
|
|
644
|
+
*/
|
|
645
|
+
export interface GetEventsArgs {
|
|
646
|
+
/** Type of event to filter by */
|
|
647
|
+
event_type?: AssetEventType | string
|
|
648
|
+
/** Filter events after this timestamp */
|
|
649
|
+
after?: number
|
|
650
|
+
/** Filter events before this timestamp */
|
|
651
|
+
before?: number
|
|
652
|
+
/** Limit the number of results */
|
|
653
|
+
limit?: number
|
|
654
|
+
/** Cursor for pagination */
|
|
655
|
+
next?: string
|
|
656
|
+
/** Chain to filter by */
|
|
657
|
+
chain?: string
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Response from OpenSea API for fetching events.
|
|
662
|
+
* @category API Response Types
|
|
663
|
+
*/
|
|
664
|
+
export type GetEventsResponse = QueryCursorsV2 & {
|
|
665
|
+
/** List of {@link AssetEvent} */
|
|
666
|
+
asset_events: AssetEvent[]
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Contract information returned by OpenSea API.
|
|
671
|
+
* @category API Models
|
|
672
|
+
*/
|
|
673
|
+
export type Contract = {
|
|
674
|
+
/** Contract address */
|
|
675
|
+
address: string
|
|
676
|
+
/** Chain the contract is deployed on */
|
|
677
|
+
chain: string
|
|
678
|
+
/** Associated collection slug (if any) */
|
|
679
|
+
collection: string | null
|
|
680
|
+
/** Contract name */
|
|
681
|
+
name: string
|
|
682
|
+
/** Contract standard (e.g., erc721, erc1155) */
|
|
683
|
+
contract_standard: string
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Response from OpenSea API for fetching a contract.
|
|
688
|
+
* @category API Response Types
|
|
689
|
+
*/
|
|
690
|
+
export type GetContractResponse = Contract
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Trait counts for a specific trait type.
|
|
694
|
+
* @category API Models
|
|
695
|
+
*/
|
|
696
|
+
export type TraitCounts = {
|
|
697
|
+
[traitValue: string]: number
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Trait categories in a collection.
|
|
702
|
+
* @category API Models
|
|
703
|
+
*/
|
|
704
|
+
export type TraitCategories = {
|
|
705
|
+
[traitType: string]: "string" | "number" | "date"
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* Response from OpenSea API for fetching collection traits.
|
|
710
|
+
* @category API Response Types
|
|
711
|
+
*/
|
|
712
|
+
export type GetTraitsResponse = {
|
|
713
|
+
/** Trait categories with their data types */
|
|
714
|
+
categories: TraitCategories
|
|
715
|
+
/** Trait counts for each category */
|
|
716
|
+
counts: {
|
|
717
|
+
[traitType: string]: TraitCounts
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* Token model returned by OpenSea API.
|
|
723
|
+
* @category API Models
|
|
724
|
+
*/
|
|
725
|
+
export type Token = {
|
|
726
|
+
/** Token contract address */
|
|
727
|
+
address: string
|
|
728
|
+
/** Chain the token is on */
|
|
729
|
+
chain: string
|
|
730
|
+
/** Token name */
|
|
731
|
+
name: string
|
|
732
|
+
/** Token symbol */
|
|
733
|
+
symbol: string
|
|
734
|
+
/** Number of decimals */
|
|
735
|
+
decimals: number
|
|
736
|
+
/** URL of the token image */
|
|
737
|
+
image_url: string | null
|
|
738
|
+
/** URL on OpenSea */
|
|
739
|
+
opensea_url: string
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* Response from OpenSea API for fetching trending tokens.
|
|
744
|
+
* @category API Response Types
|
|
745
|
+
*/
|
|
746
|
+
export type GetTrendingTokensResponse = QueryCursorsV2 & {
|
|
747
|
+
/** List of {@link Token} */
|
|
748
|
+
tokens: Token[]
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* Response from OpenSea API for fetching top tokens.
|
|
753
|
+
* @category API Response Types
|
|
754
|
+
*/
|
|
755
|
+
export type GetTopTokensResponse = QueryCursorsV2 & {
|
|
756
|
+
/** List of {@link Token} */
|
|
757
|
+
tokens: Token[]
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* Query args for Get Trending/Top Tokens endpoints.
|
|
762
|
+
* @category API Query Args
|
|
763
|
+
*/
|
|
764
|
+
export interface GetTokensArgs {
|
|
765
|
+
/** Limit the number of results */
|
|
766
|
+
limit?: number
|
|
767
|
+
/** Cursor for pagination */
|
|
768
|
+
next?: string
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
/**
|
|
772
|
+
* Query args for Get Swap Quote endpoint.
|
|
773
|
+
* @category API Query Args
|
|
774
|
+
*/
|
|
775
|
+
export interface GetSwapQuoteArgs {
|
|
776
|
+
/** Address of the input token */
|
|
777
|
+
token_in: string
|
|
778
|
+
/** Address of the output token */
|
|
779
|
+
token_out: string
|
|
780
|
+
/** Amount of input token */
|
|
781
|
+
amount: string
|
|
782
|
+
/** Chain for the swap */
|
|
783
|
+
chain: string
|
|
784
|
+
/** Address of the taker */
|
|
785
|
+
taker_address?: string
|
|
786
|
+
/** Slippage tolerance */
|
|
787
|
+
slippage?: number
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Response from OpenSea API for fetching a swap quote.
|
|
792
|
+
* @category API Response Types
|
|
793
|
+
*/
|
|
794
|
+
export type GetSwapQuoteResponse = {
|
|
795
|
+
[key: string]: unknown
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* Response from OpenSea API for fetching token details.
|
|
800
|
+
* @category API Response Types
|
|
801
|
+
*/
|
|
802
|
+
export type GetTokenResponse = Token
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Query args for the Search endpoint.
|
|
806
|
+
* @category API Query Args
|
|
807
|
+
*/
|
|
808
|
+
export interface SearchArgs {
|
|
809
|
+
/** Search query text */
|
|
810
|
+
query: string
|
|
811
|
+
/** Filter by blockchain(s) */
|
|
812
|
+
chains?: string[]
|
|
813
|
+
/** Filter by asset type(s): collection, nft, token, account */
|
|
814
|
+
asset_types?: string[]
|
|
815
|
+
/** Number of results to return (default: 20, max: 50) */
|
|
816
|
+
limit?: number
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* Collection search result.
|
|
821
|
+
* @category API Models
|
|
822
|
+
*/
|
|
823
|
+
export type CollectionSearchResult = {
|
|
824
|
+
/** The collection slug */
|
|
825
|
+
collection: string
|
|
826
|
+
/** The collection name */
|
|
827
|
+
name: string
|
|
828
|
+
/** URL of the collection image */
|
|
829
|
+
image_url: string | null
|
|
830
|
+
/** Whether trading is disabled for this collection */
|
|
831
|
+
is_disabled: boolean
|
|
832
|
+
/** Whether this collection is marked as NSFW */
|
|
833
|
+
is_nsfw: boolean
|
|
834
|
+
/** URL to the collection on OpenSea */
|
|
835
|
+
opensea_url: string
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* Token (currency) search result.
|
|
840
|
+
* @category API Models
|
|
841
|
+
*/
|
|
842
|
+
export type TokenSearchResult = {
|
|
843
|
+
/** Contract address of the token */
|
|
844
|
+
address: string
|
|
845
|
+
/** Blockchain the token is on */
|
|
846
|
+
chain: string
|
|
847
|
+
/** Token name */
|
|
848
|
+
name: string
|
|
849
|
+
/** Token symbol */
|
|
850
|
+
symbol: string
|
|
851
|
+
/** URL of the token image */
|
|
852
|
+
image_url: string | null
|
|
853
|
+
/** Current USD price of the token */
|
|
854
|
+
usd_price: string
|
|
855
|
+
/** Number of decimal places for the token */
|
|
856
|
+
decimals: number
|
|
857
|
+
/** URL to the token on OpenSea */
|
|
858
|
+
opensea_url: string
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* NFT search result.
|
|
863
|
+
* @category API Models
|
|
864
|
+
*/
|
|
865
|
+
export type NftSearchResult = {
|
|
866
|
+
/** Token ID of the NFT */
|
|
867
|
+
identifier: string
|
|
868
|
+
/** Collection slug the NFT belongs to */
|
|
869
|
+
collection: string
|
|
870
|
+
/** Contract address of the NFT */
|
|
871
|
+
contract: string
|
|
872
|
+
/** Name of the NFT */
|
|
873
|
+
name: string | null
|
|
874
|
+
/** URL of the NFT image */
|
|
875
|
+
image_url: string | null
|
|
876
|
+
/** URL to the NFT on OpenSea */
|
|
877
|
+
opensea_url: string
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
/**
|
|
881
|
+
* Account search result.
|
|
882
|
+
* @category API Models
|
|
883
|
+
*/
|
|
884
|
+
export type AccountSearchResult = {
|
|
885
|
+
/** Primary wallet address of the account */
|
|
886
|
+
address: string
|
|
887
|
+
/** Username of the account */
|
|
888
|
+
username: string | null
|
|
889
|
+
/** URL of the account's profile image */
|
|
890
|
+
profile_image_url: string | null
|
|
891
|
+
/** URL to the account on OpenSea */
|
|
892
|
+
opensea_url: string
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* A single search result with a type discriminator and the corresponding typed object.
|
|
897
|
+
* @category API Models
|
|
898
|
+
*/
|
|
899
|
+
export type SearchResult = {
|
|
900
|
+
/** The type of search result */
|
|
901
|
+
type: string
|
|
902
|
+
/** Collection details, present when type is 'collection' */
|
|
903
|
+
collection?: CollectionSearchResult
|
|
904
|
+
/** Token details, present when type is 'token' */
|
|
905
|
+
token?: TokenSearchResult
|
|
906
|
+
/** NFT details, present when type is 'nft' */
|
|
907
|
+
nft?: NftSearchResult
|
|
908
|
+
/** Account details, present when type is 'account' */
|
|
909
|
+
account?: AccountSearchResult
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
/**
|
|
913
|
+
* Response from OpenSea API for search.
|
|
914
|
+
* @category API Response Types
|
|
915
|
+
*/
|
|
916
|
+
export type SearchResponse = {
|
|
917
|
+
/** List of search results ranked by relevance */
|
|
918
|
+
results: SearchResult[]
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
/**
|
|
922
|
+
* Information about a supported blockchain.
|
|
923
|
+
* @category API Models
|
|
924
|
+
*/
|
|
925
|
+
export type ChainInfo = {
|
|
926
|
+
/** The chain identifier slug used in API paths */
|
|
927
|
+
chain: string
|
|
928
|
+
/** Human-readable chain name */
|
|
929
|
+
name: string
|
|
930
|
+
/** Native currency symbol */
|
|
931
|
+
symbol: string
|
|
932
|
+
/** Whether token swaps are supported on this chain */
|
|
933
|
+
supports_swaps: boolean
|
|
934
|
+
/** Block explorer name */
|
|
935
|
+
block_explorer: string
|
|
936
|
+
/** Block explorer base URL */
|
|
937
|
+
block_explorer_url: string
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
/**
|
|
941
|
+
* Response from OpenSea API for listing supported chains.
|
|
942
|
+
* @category API Response Types
|
|
943
|
+
*/
|
|
944
|
+
export type GetChainsResponse = {
|
|
945
|
+
/** List of supported chains */
|
|
946
|
+
chains: ChainInfo[]
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* Token balance for a wallet address.
|
|
951
|
+
* @category API Models
|
|
952
|
+
*/
|
|
953
|
+
export type TokenBalance = {
|
|
954
|
+
/** Token contract address */
|
|
955
|
+
address: string
|
|
956
|
+
/** Chain the token is on */
|
|
957
|
+
chain: string
|
|
958
|
+
/** Token name */
|
|
959
|
+
name: string
|
|
960
|
+
/** Token symbol */
|
|
961
|
+
symbol: string
|
|
962
|
+
/** URL of the token image */
|
|
963
|
+
image_url?: string
|
|
964
|
+
/** Current price in USD */
|
|
965
|
+
usd_price: string
|
|
966
|
+
/** Number of decimals */
|
|
967
|
+
decimals: number
|
|
968
|
+
/** Token balance in display units */
|
|
969
|
+
quantity: string
|
|
970
|
+
/** Total USD value of the balance */
|
|
971
|
+
usd_value: string
|
|
972
|
+
/** URL to the token page on OpenSea */
|
|
973
|
+
opensea_url: string
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* Query args for Get Account Tokens endpoint.
|
|
978
|
+
* @category API Query Args
|
|
979
|
+
*/
|
|
980
|
+
export interface GetAccountTokensArgs {
|
|
981
|
+
/** Limit the number of results */
|
|
982
|
+
limit?: number
|
|
983
|
+
/** Comma-separated chain identifiers to filter by */
|
|
984
|
+
chains?: string[]
|
|
985
|
+
/** Field to sort by */
|
|
986
|
+
sort_by?: string
|
|
987
|
+
/** Sort direction */
|
|
988
|
+
sort_direction?: "asc" | "desc"
|
|
989
|
+
/** Whether to disable spam filtering */
|
|
990
|
+
disable_spam_filtering?: boolean
|
|
991
|
+
/** Cursor for pagination */
|
|
992
|
+
cursor?: string
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
/**
|
|
996
|
+
* Response from OpenSea API for fetching account token balances.
|
|
997
|
+
* @category API Response Types
|
|
998
|
+
*/
|
|
999
|
+
export type GetAccountTokensResponse = QueryCursorsV2 & {
|
|
1000
|
+
/** List of token balances */
|
|
1001
|
+
token_balances: TokenBalance[]
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* Drop summary returned by OpenSea API.
|
|
1006
|
+
* @category API Models
|
|
1007
|
+
*/
|
|
1008
|
+
export type Drop = {
|
|
1009
|
+
/** Collection slug */
|
|
1010
|
+
collection_slug: string
|
|
1011
|
+
/** Collection name */
|
|
1012
|
+
collection_name?: string
|
|
1013
|
+
/** Blockchain the drop is on */
|
|
1014
|
+
chain: string
|
|
1015
|
+
/** Contract address */
|
|
1016
|
+
contract_address: string
|
|
1017
|
+
/** Drop type */
|
|
1018
|
+
drop_type: string
|
|
1019
|
+
/** Whether the drop is currently minting */
|
|
1020
|
+
is_minting: boolean
|
|
1021
|
+
/** Collection image URL */
|
|
1022
|
+
image_url?: string
|
|
1023
|
+
/** OpenSea URL for the drop */
|
|
1024
|
+
opensea_url: string
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
/**
|
|
1028
|
+
* Drop stage information.
|
|
1029
|
+
* @category API Models
|
|
1030
|
+
*/
|
|
1031
|
+
export type DropStage = {
|
|
1032
|
+
/** Stage UUID */
|
|
1033
|
+
uuid: string
|
|
1034
|
+
/** Stage type (e.g. public_sale) */
|
|
1035
|
+
stage_type: string
|
|
1036
|
+
/** Stage label/name */
|
|
1037
|
+
label?: string
|
|
1038
|
+
/** Mint price per token in wei */
|
|
1039
|
+
price?: string
|
|
1040
|
+
/** Currency contract address */
|
|
1041
|
+
price_currency_address: string
|
|
1042
|
+
/** Stage start time (ISO 8601) */
|
|
1043
|
+
start_time: string
|
|
1044
|
+
/** Stage end time (ISO 8601) */
|
|
1045
|
+
end_time: string
|
|
1046
|
+
/** Max tokens mintable per wallet in this stage */
|
|
1047
|
+
max_per_wallet: string
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
/**
|
|
1051
|
+
* Detailed drop information including stages and supply.
|
|
1052
|
+
* @category API Models
|
|
1053
|
+
*/
|
|
1054
|
+
export type DropDetailed = Drop & {
|
|
1055
|
+
/** Drop stages (public sale, presale, etc.) */
|
|
1056
|
+
stages: DropStage[]
|
|
1057
|
+
/** Total minted supply */
|
|
1058
|
+
total_supply?: string
|
|
1059
|
+
/** Maximum supply */
|
|
1060
|
+
max_supply?: string
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
/**
|
|
1064
|
+
* Response from OpenSea API for fetching a list of drops.
|
|
1065
|
+
* @category API Response Types
|
|
1066
|
+
*/
|
|
1067
|
+
export type GetDropsResponse = QueryCursorsV2 & {
|
|
1068
|
+
/** List of {@link Drop} */
|
|
1069
|
+
drops: Drop[]
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
/**
|
|
1073
|
+
* Response from OpenSea API for fetching a single drop.
|
|
1074
|
+
* @category API Response Types
|
|
1075
|
+
*/
|
|
1076
|
+
export type GetDropResponse = DropDetailed
|
|
1077
|
+
|
|
1078
|
+
/**
|
|
1079
|
+
* Query args for Get Drops endpoint.
|
|
1080
|
+
* @category API Query Args
|
|
1081
|
+
*/
|
|
1082
|
+
export interface GetDropsArgs {
|
|
1083
|
+
/** Drop calendar type: featured, upcoming, or recently_minted */
|
|
1084
|
+
type?: string
|
|
1085
|
+
/** Limit the number of results */
|
|
1086
|
+
limit?: number
|
|
1087
|
+
/** Comma-separated chains to filter by */
|
|
1088
|
+
chains?: string[]
|
|
1089
|
+
/** Cursor for pagination */
|
|
1090
|
+
cursor?: string
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
/**
|
|
1094
|
+
* Request body for building a drop mint transaction.
|
|
1095
|
+
* @category API Request Types
|
|
1096
|
+
*/
|
|
1097
|
+
export type DropMintRequest = {
|
|
1098
|
+
/** Wallet address that will receive the minted tokens */
|
|
1099
|
+
minter: string
|
|
1100
|
+
/** Number of tokens to mint (1-100) */
|
|
1101
|
+
quantity: number
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
/**
|
|
1105
|
+
* Response from OpenSea API for building a drop mint transaction.
|
|
1106
|
+
* @category API Response Types
|
|
1107
|
+
*/
|
|
1108
|
+
export type DropMintResponse = {
|
|
1109
|
+
/** Transaction target contract address */
|
|
1110
|
+
to: string
|
|
1111
|
+
/** Encoded transaction data (hex) */
|
|
1112
|
+
data: string
|
|
1113
|
+
/** Transaction value in wei (hex) */
|
|
1114
|
+
value: string
|
|
1115
|
+
/** Chain identifier */
|
|
1116
|
+
chain: string
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
/**
|
|
1120
|
+
* Query args for Get Trending Collections endpoint.
|
|
1121
|
+
* @category API Query Args
|
|
1122
|
+
*/
|
|
1123
|
+
export interface GetTrendingCollectionsArgs {
|
|
1124
|
+
/** Time window: one_minute, five_minutes, fifteen_minutes, one_hour, one_day, seven_days, thirty_days, one_year, all_time */
|
|
1125
|
+
timeframe?: string
|
|
1126
|
+
/** Blockchain(s) to filter by */
|
|
1127
|
+
chains?: string[]
|
|
1128
|
+
/** Category to filter by (e.g. art, gaming, pfps) */
|
|
1129
|
+
category?: string
|
|
1130
|
+
/** Maximum number of collections to return (1-100) */
|
|
1131
|
+
limit?: number
|
|
1132
|
+
/** Cursor for pagination */
|
|
1133
|
+
cursor?: string
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* Query args for Get Top Collections endpoint.
|
|
1138
|
+
* @category API Query Args
|
|
1139
|
+
*/
|
|
1140
|
+
export interface GetTopCollectionsArgs {
|
|
1141
|
+
/** Sort by: one_day_volume, seven_days_volume, thirty_days_volume, floor_price, one_day_sales, etc. */
|
|
1142
|
+
sort_by?: string
|
|
1143
|
+
/** Blockchain(s) to filter by */
|
|
1144
|
+
chains?: string[]
|
|
1145
|
+
/** Category to filter by (e.g. art, gaming, pfps) */
|
|
1146
|
+
category?: string
|
|
1147
|
+
/** Maximum number of collections to return (1-100) */
|
|
1148
|
+
limit?: number
|
|
1149
|
+
/** Cursor for pagination */
|
|
1150
|
+
cursor?: string
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
/**
|
|
1154
|
+
* Response from OpenSea API for trending/top collections.
|
|
1155
|
+
* @category API Response Types
|
|
1156
|
+
*/
|
|
1157
|
+
export type GetCollectionsPaginatedResponse = QueryCursorsV2 & {
|
|
1158
|
+
collections: OpenSeaCollection[]
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
/**
|
|
1162
|
+
* Response from OpenSea API for resolving an account identifier.
|
|
1163
|
+
* @category API Response Types
|
|
1164
|
+
*/
|
|
1165
|
+
export type ResolveAccountResponse = {
|
|
1166
|
+
/** The resolved wallet address */
|
|
1167
|
+
address: string
|
|
1168
|
+
/** OpenSea username, if available */
|
|
1169
|
+
username?: string
|
|
1170
|
+
/** Primary ENS name, if available */
|
|
1171
|
+
ens_name?: string
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
/**
|
|
1175
|
+
* Response from OpenSea API for validating NFT metadata.
|
|
1176
|
+
* @category API Response Types
|
|
1177
|
+
*/
|
|
1178
|
+
export type ValidateMetadataResponse = {
|
|
1179
|
+
/** The asset being validated */
|
|
1180
|
+
assetIdentifier: {
|
|
1181
|
+
chain: string
|
|
1182
|
+
contractAddress: string
|
|
1183
|
+
tokenId: string
|
|
1184
|
+
}
|
|
1185
|
+
/** The token URI */
|
|
1186
|
+
tokenUri?: string
|
|
1187
|
+
/** Parsed metadata details */
|
|
1188
|
+
metadata?: {
|
|
1189
|
+
name?: string
|
|
1190
|
+
description?: string
|
|
1191
|
+
originalImageUrl?: string
|
|
1192
|
+
processedImageUrl?: string
|
|
1193
|
+
originalAnimationUrl?: string
|
|
1194
|
+
processedAnimationUrl?: string
|
|
1195
|
+
externalUrl?: string
|
|
1196
|
+
backgroundColor?: string
|
|
1197
|
+
attributes: {
|
|
1198
|
+
traitType: string
|
|
1199
|
+
value: string
|
|
1200
|
+
displayType?: string
|
|
1201
|
+
}[]
|
|
1202
|
+
}
|
|
1203
|
+
/** Error encountered during metadata ingestion */
|
|
1204
|
+
error?: {
|
|
1205
|
+
errorType: string
|
|
1206
|
+
message: string
|
|
1207
|
+
url?: string
|
|
1208
|
+
statusCode?: number
|
|
1209
|
+
}
|
|
1210
|
+
}
|