简体   繁体   中英

How to set price for all NFTs in a collection on opensea?

If I mint a collection of n items on my own address ( via smart contract ), it'll be publicly visible on my account under the collected / created section like this .

The problem is that, in order to complete the listing I must manually set the price of each NFT individually. Obviously this is not practical, since I cannot set the price of every NFT one by one manually, not to mention that every time a listing is completed ( by setting the price ), gas fee has to be paid.

Therefore I want to be able to achieve setting the price programatically such that after minting, the collection looks like this .

I tried to approach this problem via OpenSea-Creatures SDK ( which uses Truffle ), but Im not sure if their sales-contract can achieve this. ( I couldn't get it to run either ).

I know this question is very generic but I've been looking for a solution for a while and I haven't found anything helpful.

Any guidance in the right direction would be of tremendous help

I also faced the same issue when i was creating a large NFT collections of over 3,000. The best solution i will recommend is Creating a Custom Sale Contract .

The downside of the simple item sale is that you'll need pre-mint the items that you want to sell (as opposed to minting them on the fly when they're purchased). This can make it difficult to sell many items to a broad user base. Additionally, with the simple item sale method, it's difficult to create custom logic for the sale of your items (like packs of random items, randomized stats for the items that are minted, etc.). If you want any of these features, the Factory contract is for you

In order to mint items only when they're purchased, OpenSea provides a Factory interface that you can use to define how your items will be minted. You then use OpenSea to create custom "orders" that call your minting function. Here's a look at the main mint method of the Factory contract.

Selling many of one option

While the OpenSea UI lets you sell one Factory item at a time, in many circumstances, you may want to sell off a large number of items to your initial users: for example, 100 swords or 100 packs of cards. For this, we recommend using the SDK to instantly create sales with a given supply. As an example, suppose you wanted to put 100 items up for sale in your crowdsale for a fixed price, expiring tomorrow. You could do the following:

 // Expire these auctions one day from now. Omit `expirationTime` or set to 0 to never expire: const expirationTime = (Date.now() / 1000 + 60 * 60 * 24) const sellOrders = await seaport.createFactorySellOrders({ assetId: <ASSET_OPTION_ID>, factoryAddress: <FACTORY_CONTRACT_ADDRESS>, accountAddress, startAmount, expirationTime, numberOfOrders: 100 // Will create 100 sell orders in parallel batches to speed things up })

Check this link to see how to create a factory contract https://docs.opensea.io/docs/2-custom-item-sale-contract @Ngyfsoau

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM