Repository navigation
Releases: ProjectOpenSea/opensea-sdk
Releases · ProjectOpenSea/opensea-sdk
Release list
v12.13.2
What's Changed
- Collection offers made with
traitTypeandtraitValuenow send the trait as a one-elementcriteria.traitsarray instead of the deprecated singlecriteria.traitfield, on bothPOST /api/v2/offers/buildandPOST /api/v2/offers. The API treats the two shapes the same, so the resulting offer does not change, and thetraitTypeandtraitValuearguments keep working. getTopPfpCollectionsdocumentsargs.chainsin place of the deprecatedchainparam ofGET /api/v2/pfp/top-collections.- Depends on
@opensea/api-types0.17.1.
Full Changelog: v12.13.1...v12.13.2
v12.13.1
What's Changed
- The README banner now carries the new OpenSea brand, with the new logo on the original banner art. The image is hosted on raw2.seadn.io, so
img/banner.pngis no longer part of the repo.
Full Changelog: v12.13.0...v12.13.1
v12.13.0
What's Changed
The SDK now covers every operation in the OpenSea API v2 spec.
- Collections:
api.collections.getCreatorFeeEnforcement,getCollectionPfpProfilesandgetTopPfpCollections, plus wallet-authenticatedapi.walletAuth.getCollectionMetadata,createCollectionPageMediaUpload,setCollectionPricingCurrency,buildCreatorFeeEnforcementTransactionsandrefreshCollectionMetadata. - Tools (beta): new
api.toolsnamespace withlistTools,searchTools,getTool,getToolActivityandreportToolUsage.getToolreturns the tool'sinputsandoutputsJSON Schemas with their keys as sent; the rest of the response is camelCase. Saved tools stay onapi.walletAuth. - Drops:
api.walletAuth.listDropItems(slug, { limit?, next? }), which needs a wallet token withwrite:dropsfrom the collection owner or an editor. - Profiles:
api.walletAuth.getProfileShelves(address). - Uploads:
uploadToContext,selectUploadContextandUploadContextErrorfinish the presigned upload flows that the fivewalletAuth.create*Uploadhelpers start.uploadToContextsends the file to the context's HTTPS storage URL with the globalfetch, refuses redirects, never sends your API key or wallet token to storage, and never reads the storage response; errors carry only the HTTP status. - Stream transport: a caller that removes its handler inside its own join callback no longer causes the next caller on the same topic to miss the join result, and a caller that subscribes from inside a join callback is told once instead of twice.
OpenSeaStreamClientonly logs from these callbacks, so its behavior is unchanged. - Requires
@opensea/api-types0.17.0.
Community Contributions
- Stream join-callback fix, thanks @Osraka (opensea-sdk#2029, opensea-sdk#2030)
Full Changelog: v12.12.0...v12.13.0
v12.12.0
What's Changed
- Add the collection group NFT search and facets endpoints, which search NFTs across every collection in a group, such as
trading_cards, by normalized attributes (franchise, grader, grade, subject, year, set, language, edition, product type):api.nfts.getNFTsByGroup(group, args?)(GET /api/v2/nfts/group/{group}) takesGetNFTsByGroupArgsand returnsGetNFTsByGroupResponse.api.nfts.getNFTGroupFacets(group, args?)(GET /api/v2/nfts/group/{group}/facets) takesGetNFTGroupFacetsArgsand returnsGetNFTGroupFacetsResponse.- Attribute filters are string arrays sent as repeated query parameters. Values of one filter match any of them, and different filters are AND-combined.
- Depends on
@opensea/api-types0.16.1.
import type { OpenSeaSDK } from "@opensea/sdk"
declare const sdk: OpenSeaSDK
const { facets } = await sdk.api.nfts.getNFTGroupFacets("trading_cards", {
facetTypes: ["grader"],
franchise: ["Pokemon"],
})
const { nfts, next } = await sdk.api.nfts.getNFTsByGroup("trading_cards", {
franchise: ["Pokemon"],
grader: ["PSA", "CGC"],
isListed: true,
sortBy: "price",
sortDirection: "asc",
})Full Changelog: v12.11.4...v12.12.0
v12.11.4
What's Changed
- Sign-in with Ethereum messages now accept the "Platform Terms of Service" instead of the "OpenSea Terms of Service". The linked URLs are unchanged.
- Depends on
@opensea/api-types0.16.1.
Full Changelog: v12.11.3...v12.11.4
v12.11.3
What's Changed
- Stream: removing a listener now also drops that caller's
onSubscribedandonSubscribeErrorcallbacks once it has no handlers left on the topic. Before, a caller that unsubscribed from a topic another listener kept alive was still notified on every rejoin, and repeated add and remove cycles kept growing the topic's callback list. - Docs:
_createRateLimitErrorhas its own JSDoc again. The Avalanche case ofgetListingPaymentTokenlabels its address WAVAX. The quick start, overview and contributing guides state Node 22 as the minimum, matchingengines.node. - Depends on
@opensea/api-types0.16.0.
Community Contributions
- Stream callback bug report and reproduction, thanks @Osraka (opensea-sdk#2027)
_createRateLimitErrorJSDoc and Node 22 docs, thanks @dj-jarvis (opensea-sdk#2023, opensea-sdk#2024)- Avalanche token label, thanks @qsysvcore (opensea-sdk#2026)
Full Changelog: v12.11.2...v12.11.3
v12.11.2
What's Changed
- Stream: when a second subscriber joins a collection topic that is already joined and asks for event types outside the current filter, the server-side filter now widens before that subscriber is notified. Its
onSubscribedfires once, after the widened join is accepted, instead of once before and once after. A throw from that callback is reported throughonErrorinstead of escapingsubscribe()and skipping the widen. - Docs: the package entry
@examplenow passesapiKey. - Docs: the
snakeizeKeysDeepJSDoc gives the real output forURL(u_r_l, noturl). The 11.0.0 changelog entry had the same wrong example and is corrected too. - Docs: the "Buying Items" and "Accepting Offers" examples in the getting-started guide no longer import an unused
OrderSide.
Community Contributions
- Stream filter widening and late
onSubscribedhandling, thanks @Osraka (opensea-sdk#2022) apiKeyin the entry-point example, thanks @CryptAm (opensea-sdk#2020)snakeizeKeysDeepacronym example, thanks @zunixport (opensea-sdk#2019)- Unused
OrderSideimports in getting-started, thanks @CryptAm (opensea-sdk#2021)
Full Changelog: v12.11.1...v12.11.2
v12.11.1
What's Changed
- Stream transport: a join reply that arrives after the join was replaced (filter widen, rejoin) or after the topic was unsubscribed no longer fires
onSubscribedoronSubscribeErrora second time. Snakeize<T>now matches whatsnakeizeKeysDeepwrites at runtime: no underscore before digits (chain2Idischain2_id) and no doubled underscore on keys that are already snake_case (order_hashstaysorder_hash).hasErrorCodereturnsfalsefornullandundefinedinstead of throwing aTypeError.- CI now type-checks the shipped declarations with
skipLibCheck: false.
Community Contributions
- Stale stream join replies double-firing subscribe callbacks, thanks @bayrakdarerdem (opensea-sdk#2018)
Snakeize<T>digit handling, thanks @zunixport (opensea-sdk#2015)- Nullish-safe
hasErrorCode, thanks @zunixport (opensea-sdk#2014) - Declarations check on this repo's CI, reported by @Osraka (opensea-sdk#2016)
Full Changelog: v12.11.0...v12.11.1
v12.11.0
What's Changed
- Add
walletAuth.saveDropItemMediaBatch(slug, { uploadBatchId, filenames }), which saves a drop's items from one upload batch by filename, up to 15,000. Pass the sameuploadBatchId, a UUID you generate once per set of files, to everywalletAuth.createDropItemMediaUploadcall for that set. walletAuth.saveDropItemMedia, which saves by media token, is deprecated and keeps working.- Depends on
@opensea/api-types0.15.0.
Full Changelog: v12.10.2...v12.11.0
v12.10.2
What's Changed
api.tokens.getTokenHolders()now types and documents the holder distribution:totalHolders,topHoldersCount(the measured top cohort, 250 or every holder when there are fewer),topHoldersConcentration(percent of eligible supply that cohort holds, after mint, LP, CEX and burn holdings are excluded),healthScoreandhealthLabel.distributionis null for tokens the API has not measured.topOnePercentConcentrationis deprecated in favor oftopHoldersConcentration. The new fields come from@opensea/api-types0.14.2.
import { Chain, type OpenSeaSDK } from "@opensea/sdk"
declare const sdk: OpenSeaSDK
const { distribution } = await sdk.api.tokens.getTokenHolders(
Chain.Base,
"0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b",
)
if (distribution) {
console.log(distribution.topHoldersConcentration, distribution.topHoldersCount)
}- The published declarations typecheck with
skipLibCheck: false.usesNativeStablecoinOffers(chain)declared a type predicate TypeScript rejects (TS2677); it is nowchain is Chain.Arc | Chain.StableChain. Runtime behavior is unchanged.
Full Changelog: v12.10.1...v12.10.2