简体   繁体   English

如何为 opensea 集合中的所有 NFT 定价?

[英]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 .如果我在自己的地址(通过智能合约)上铸造了n 个项目的集合,它将在我的帐户上的收集/创建部分下公开可见,如下所示

The problem is that, in order to complete the listing I must manually set the price of each NFT individually.问题是,为了完成上市,我必须单独手动设置每个 NFT 的价格 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.显然这是不切实际的,因为我无法手动设置每个 NFT 的价格,更何况每次上币(通过设置价格)都必须支付gas 费

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.我试图通过OpenSea-Creatures SDK使用 Truffle )来解决这个问题,但我不确定他们的销售合同是否可以实现这一点。 ( 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.当我创建一个超过 3,000 个的大型 NFT collections 时,我也遇到了同样的问题。 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.为了仅在购买时铸造物品,OpenSea 提供了一个工厂界面,您可以使用该界面来定义您的物品将如何铸造。 You then use OpenSea to create custom "orders" that call your minting function.然后,您使用 OpenSea 创建自定义“订单”,调用您的铸币 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.尽管 OpenSea UI 允许您一次出售一件工厂物品,但在许多情况下,您可能希望向初始用户出售大量物品:例如,100 把剑或 100 包卡片。 For this, we recommend using the SDK to instantly create sales with a given supply.为此,我们建议使用 SDK 在给定供应的情况下立即创造销售。 As an example, suppose you wanted to put 100 items up for sale in your crowdsale for a fixed price, expiring tomorrow.例如,假设您想在众筹中以固定价格出售 100 件商品,明天到期。 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检查此链接以了解如何创建工厂合同https: //docs.opensea.io/docs/2-custom-item-sale-contract @Ngyfsoau

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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