Create a new instance of OpenSeaSDK.
Signer or provider to use for transactions. For example:
new ethers.providers.JsonRpcProvider('https://mainnet.infura.io') or
new ethers.Wallet(privKey, provider)
configuration options, including chain
Optionallogger: (arg: string) => voidoptional function for logging debug strings. defaults to no logging
ReadonlyapiAPI instance
ReadonlychainThe configured chain
Logger function to use when debugging
Provider to use for transactions.
Seaport client
Add a listener for events emitted by the SDK.
Instead of signing an off-chain order, this method allows you to approve an order with an on-chain transaction.
Order to approve
Optionaldomain: stringAn optional domain to be hashed and included at the end of fulfillment calldata. This can be used for on-chain order attribution to assist with analytics.
Transaction hash of the approval transaction
Error if the order's protocol address is not supported by OpenSea. See isValidProtocol.
Batch approve multiple assets for transfer to the OpenSea conduit. This method checks which assets need approval and batches them efficiently:
Array of assets to approve for transfer
The address that owns the assets
Optionaloverrides?: OverridesTransaction overrides, ignored if not set.
Transaction hash of the approval transaction, or undefined if no approvals needed
Bulk transfer multiple assets using OpenSea's TransferHelper contract. This method is more gas-efficient than calling transfer() multiple times. Note: All assets must be approved for transfer to the OpenSea conduit before calling this method.
Array of assets to transfer. Each asset must have tokenStandard set.
The address to transfer from
Optionaloverrides?: OverridesTransaction overrides, ignored if not set.
Transaction hash of the bulk transfer
Cancel an order onchain, preventing it from ever being fulfilled. This method accepts either a full OrderV2 object or an order hash with protocol address.
The account address that will be cancelling the order.
Optionaldomain?: stringOptional domain for on-chain attribution. Hashed and included in calldata.
Optionalorder?: OrderV2The order to cancel (OrderV2 object)
OptionalorderHash?: stringOptional order hash to cancel. Must provide protocolAddress if using this.
OptionalprotocolAddress?: stringRequired when using orderHash. The Seaport protocol address for the order.
Error if the order's protocol address is not supported by OpenSea. See isValidProtocol.
Cancel multiple orders onchain, preventing them from being fulfilled. This method accepts either full OrderV2 objects, OrderComponents, or order hashes with protocol address.
Event Behavior: For backwards compatibility with the singular cancelOrder method,
this method dispatches a CancelOrder event for the first order only, and only when
an OrderV2 object is available (either provided directly or fetched via orderHashes).
No event is dispatched when using OrderComponents directly, as they lack the full order data.
The account address cancelling the orders.
Optionaldomain?: stringOptional domain for on-chain attribution. Hashed and included in calldata.
OptionalorderHashes?: string[]Optional array of order hashes to cancel. Must provide protocolAddress if using this.
Optionalorders?: (OrderV2 | OrderComponents)[]Array of orders to cancel. Can be OrderV2 objects or OrderComponents.
Optionaloverrides?: OverridesTransaction overrides, ignored if not set.
OptionalprotocolAddress?: stringRequired when using orderHashes. The Seaport protocol address for the orders.
Transaction hash of the cancellation.
Error if the order's protocol address is not supported by OpenSea. See isValidProtocol.
Create and submit multiple listings using Seaport's bulk order creation. This method uses a single signature for all listings and submits them individually to the OpenSea API with rate limit handling. All listings must be from the same account address.
Note: If only one listing is provided, this method will use a normal order signature instead of a bulk signature, as bulk signatures are more expensive to decode on-chain due to the merkle proof verification.
Address of the wallet making the listings
OptionalcontinueOnError?: booleanIf true, continue submitting remaining listings even if some fail. Default: false (throw on first error).
Array of listing parameters. Each listing requires asset, amount, and optionally other listing parameters.
OptionalonProgress?: (completed: number, total: number) => voidOptional callback for progress updates. Called after each listing is submitted (successfully or not).
BulkOrderResult containing successful orders and any failures.
Create and submit multiple offers using Seaport's bulk order creation. This method uses a single signature for all offers and submits them individually to the OpenSea API with rate limit handling. All offers must be from the same account address.
Note: If only one offer is provided, this method will use a normal order signature instead of a bulk signature, as bulk signatures are more expensive to decode on-chain due to the merkle proof verification.
Address of the wallet making the offers
OptionalcontinueOnError?: booleanIf true, continue submitting remaining offers even if some fail. Default: false (throw on first error).
Array of offer parameters. Each offer requires asset, amount, and optionally other offer parameters.
OptionalonProgress?: (completed: number, total: number) => voidOptional callback for progress updates. Called after each offer is submitted (successfully or not).
BulkOrderResult containing successful orders and any failures.
Create and submit a collection offer.
Address of the wallet making the offer.
Amount in decimal format (e.g., "1.5" for 1.5 ETH, not wei). Automatically converted to base units.
Identifier for the collection.
Optionaldomain?: stringOptional domain for on-chain attribution. Hashed and included in salt.
OptionalexpirationTime?: string | numberExpiration time (UTC seconds).
OptionalnumericTraits?: { max?: number; min?: number; type: string }[]If defined, an array of numeric trait criteria with min/max ranges.
OptionalofferProtectionEnabled?: booleanUse signed zone for protection against disabled items. Default: true.
Number of assets to bid for.
Optionalsalt?: BigNumberishArbitrary salt. Auto-generated if not provided.
Optionaltraits?: { type: string; value: string }[]If defined, an array of traits to create the multi-trait collection offer for.
OptionaltraitType?: stringIf defined, the trait name to create the collection offer for.
OptionaltraitValue?: stringIf defined, the trait value to create the collection offer for.
The CollectionOffer that was created.
Create and submit a listing for an asset.
Address of the wallet making the listing
Amount in decimal format (e.g., "1.5" for 1.5 ETH, not wei). Automatically converted to base units.
The asset to trade. tokenAddress and tokenId must be defined.
OptionalbuyerAddress?: stringOptional address that's allowed to purchase this item. If specified, no other address will be able to take the order, unless its value is the null address.
Optionaldomain?: stringOptional domain for on-chain attribution. Hashed and included in salt.
OptionalexpirationTime?: numberExpiration time for the order, in UTC seconds.
OptionalincludeOptionalCreatorFees?: booleanIf true, optional creator fees will be included in the listing. Default: false.
OptionallistingTime?: numberOptional time when the order will become fulfillable, in UTC seconds. Undefined means it will start now.
Optionalquantity?: BigNumberishNumber of assets to list. Defaults to 1.
Optionalsalt?: BigNumberishArbitrary salt. Auto-generated if not provided.
Optionalzone?: stringZone for order protection. Defaults to no zone.
The OrderV2 that was created.
Create and validate a listing onchain. Combines order building with onchain validation. Validation costs gas upfront but makes fulfillment cheaper (no signature verification needed).
Address of the wallet making the listing
Amount in decimal format (e.g., "1.5" for 1.5 ETH, not wei). Automatically converted to base units.
The asset to trade. tokenAddress and tokenId must be defined.
OptionalbuyerAddress?: stringOptional buyer restriction. Only this address can purchase.
Optionaldomain?: stringOptional domain for on-chain attribution. Hashed and included in salt.
OptionalexpirationTime?: numberExpiration time (UTC seconds).
OptionalincludeOptionalCreatorFees?: booleanInclude optional creator fees. Default: false.
OptionallistingTime?: numberWhen order becomes fulfillable (UTC seconds). Defaults to now.
Optionalquantity?: BigNumberishNumber of assets to list. Defaults to 1.
Optionalsalt?: BigNumberishArbitrary salt. Auto-generated if not provided.
Optionalzone?: stringZone for order protection. Defaults to no zone.
Transaction hash
Create and submit an offer on an asset.
Address of the wallet making the offer.
Amount in decimal format (e.g., "1.5" for 1.5 ETH, not wei). Automatically converted to base units.
The asset to trade. tokenAddress and tokenId must be defined.
Optionaldomain?: stringOptional domain for on-chain attribution. Hashed and included in salt.
OptionalexpirationTime?: BigNumberishExpiration time for the order, in UTC seconds
Optionalquantity?: BigNumberishNumber of assets to bid for. Defaults to 1.
Optionalsalt?: BigNumberishArbitrary salt. Auto-generated if not provided.
Optionalzone?: stringZone for order protection. Defaults to chain's signed zone.
The OrderV2 that was created.
Create and validate an offer onchain. Combines order building with onchain validation. Validation costs gas upfront but makes fulfillment cheaper (no signature verification needed).
Address of the wallet making the offer.
Amount in decimal format (e.g., "1.5" for 1.5 ETH, not wei). Automatically converted to base units.
The asset to trade. tokenAddress and tokenId must be defined.
Optionaldomain?: stringOptional domain for on-chain attribution. Hashed and included in salt.
OptionalexpirationTime?: BigNumberishExpiration time (UTC seconds).
Optionalquantity?: BigNumberishNumber of assets to bid for. Defaults to 1.
Optionalsalt?: BigNumberishArbitrary salt. Auto-generated if not provided.
Optionalzone?: stringZone for order protection. Defaults to chain's signed zone.
Transaction hash
Fulfill an order for an asset. The order can be either a listing or an offer. Uses the OpenSea API to generate fulfillment transaction data and executes it directly.
Address of the wallet taking the offer.
OptionalassetContractAddress?: stringOptional address of the NFT contract for criteria offers (e.g., collection offers). Required when fulfilling collection offers.
OptionalincludeOptionalCreatorFees?: booleanWhether to include optional creator fees in the fulfillment. If creator fees are already required, this is a no-op. Defaults to false.
The order to fulfill, a.k.a. "take"
Optionaloverrides?: OverridesTransaction overrides, ignored if not set.
OptionalrecipientAddress?: stringOptional recipient address for the NFT when fulfilling a listing. Not applicable for offers.
OptionaltokenId?: stringOptional token ID for criteria offers (e.g., collection offers). Required when fulfilling collection offers.
OptionalunitsToFill?: BigNumberishOptional number of units to fill. Defaults to 1 for both listings and offers.
Transaction hash of the order.
Error if the order's protocol address is not supported by OpenSea. See isValidProtocol.
Get an account's balance of any Asset. This asset can be an ERC20, ERC1155, or ERC721.
Account address to check
The Asset to check balance for. tokenStandard must be set.
The balance of the asset for the account.
Returns whether an order is fulfillable. An order may not be fulfillable if a target item's transfer function is locked for some reason, e.g. an item is being rented within a game or trading has been locked for an item type.
True if the order is fulfillable, else False.
Error if the order's protocol address is not supported by OpenSea. See isValidProtocol.
Offchain cancel an order, offer or listing, by its order hash when protected by the SignedZone. Protocol and Chain are required to prevent hash collisions. Please note cancellation is only assured if a fulfillment signature was not vended prior to cancellation.
The Seaport address for the order.
The order hash, or external identifier, of the order.
The chain where the order is located.
OptionaloffererSignature: stringAn EIP-712 signature from the offerer of the order.
If this is not provided, the API key used to initialize the SDK must belong to the order's offerer.
The signature must be a EIP-712 signature consisting of the order's Seaport contract's
name, version, address, and chain. The struct to sign is OrderHash containing a
single bytes32 field.
OptionaluseSignerToDeriveOffererSignature: booleanDerive the offererSignature from the Ethers signer passed into this sdk.
The response from the API.
Remove all event listeners. This should be called when you're unmounting a component that listens to events to make UI updates.
Optionalevent: EventTypeOptional EventType to remove listeners for
Transfer an asset. This asset can be an ERC20, ERC1155, or ERC721.
Optionalamount?: BigNumberishAmount of asset to transfer. Not used for ERC721.
The Asset to transfer. tokenStandard must be set.
The address to transfer from
Optionaloverrides?: OverridesTransaction overrides, ignored if not set.
The address to transfer to
Unwrap wrapped native asset into native asset (e.g. WETH into ETH, WPOL into POL).
Emits the UnwrapWeth event when the transaction is prompted.
Address of the user's wallet containing the wrapped native asset
How much wrapped native asset to unwrap
Validates an order onchain using Seaport's validate() method. This submits the order onchain and pre-validates the order using Seaport, which makes it cheaper to fulfill since a signature is not needed to be verified during fulfillment for the order, but is not strictly required and the alternative is orders can be submitted to the API for free instead of sent onchain.
Order components to validate onchain
Address of the wallet that will pay the gas to validate the order
Transaction hash of the validation transaction
Wrap native asset into wrapped native asset (e.g. ETH into WETH, POL into WPOL). Wrapped native assets are needed for making offers.
Address of the user's wallet containing the native asset
Amount of native asset to wrap
The OpenSea SDK main class.