ProjectOpenSea / opensea-js

TypeScript SDK for the OpenSea marketplace
https://docs.opensea.io/reference
MIT License
2.28k stars 964 forks source link

Enhancement Request: Separate OpenSeaSDK Parameters for NFT Endpoints and Marketplace Endpoints #1569

Open MuhammadMinhaj opened 1 month ago

MuhammadMinhaj commented 1 month ago

Component

API

Describe the feature you would like

Hello OpenSea team,

We appreciate the support provided for both NFT Endpoints and OpenSea Marketplace Endpoints in the OpenSea SDK (opensea-js). Based on the documentation, we understand that after creating an instance of OpenSeaSDK, we can access the NFT Endpoints via sdkInstance.api.[endpoint method] and the OpenSea Marketplace Endpoints via sdkInstance.[Marketplace Endpoints methods].

Currently, to create an instance of OpenSeaSDK, we are required to provide (signerOrProvider: Signer | JsonRpcProvider) as a parameter, regardless of whether we need access to the OpenSea Marketplace Endpoints or not.

However, in scenarios where we only need to interact with the NFT Endpoints, it seems unnecessary to provide (signerOrProvider: Signer | JsonRpcProvider) since these endpoints don't require signing or provider capabilities. This adds extra complexity when using only the NFT APIs.

I would like to propose separating the parameter requirements for accessing the NFT Endpoints, allowing developers to instantiate the OpenSeaSDK without providing signerOrProvider when only interacting with NFT Endpoints. This would simplify the integration for NFT-focused use cases and improve overall developer experience.

Thank you for considering this enhancement!

Additional context

Screenshot 2024-10-09 013951

ryanio commented 3 weeks ago

thanks for the suggestion. we will keep this in mind for future major versions of opensea-js