Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Opensea Polygon Script To Auto Sell NFTs #42

Closed
thepeanutgalleryandco opened this issue Mar 23, 2022 · 8 comments · Fixed by #43
Closed

[FEATURE] Opensea Polygon Script To Auto Sell NFTs #42

thepeanutgalleryandco opened this issue Mar 23, 2022 · 8 comments · Fixed by #43
Assignees
Labels
enhancement New feature or request

Comments

@thepeanutgalleryandco
Copy link
Owner

thepeanutgalleryandco commented Mar 23, 2022

Summary

Create a new script that can be used to automate the selling of NFTs for a specific price. As this is the initial script, only need to cater for a single price for all the NFTs that needs to be put up for sale. Script only needs to cater for putting Polygon NFTs up for sale in the initial build.

Basic example

Add a new script that can take a seed phrase to your wallet that contains the NFTs that needs to be put up for sale, a start edition number, an end edition number, a price and a contract address.

StartEdition: 1
EndEdition: 10
Price: 0.002 (Above $5, as that is the minimum)
Contract: 0x09aa1a14e572e6fc05f64e541699d3e0361c7f2f
Seed Phrase: one two three mountain lion test four five six big small town

Auto login to Opensea with the Seed phrase for the wallet that owns the NFTs that should be sold. Loop through editions 1 through to 10 (both inclusive) on the contract address and put each NFT up for sale if it can find the NFT edition number and your wallet owns it. Should the items be owned by someone else or the edition can't be found, then skip over to the next edition.

Motivation

This will allow users to put their NFTs up for sale automatically by simply running a script instead of manually putting each item up for sale.

@thepeanutgalleryandco thepeanutgalleryandco added the enhancement New feature or request label Mar 23, 2022
@thepeanutgalleryandco thepeanutgalleryandco self-assigned this Mar 23, 2022
@thepeanutgalleryandco
Copy link
Owner Author

thepeanutgalleryandco commented Mar 23, 2022

This script has been quite tricky to get working 100% as some of the libraries have some issues at times.

A new library called @chainsafe/dappeteer has been introduced. Even though version 2.4.x has been released, I was unable to get the Metamask functionality to work correctly on this. I got the automation to work by using specifically version 2.3.0 (not greater than 2.3.0) along with specifically version 10.1.1 of Metamask. All other version combinations failed in automation testing, so please do not change these versions for the time being, unless the code base receives an update for this.

There's a few configurations that needs to be put in place for this automation script to work, so please update accordingly before running the npm run sell_nfts command.

  • Update the constants/account_details.js file's contract_address field with the contract that contains the NFTs that needs to be put up for sale. Also update the chain field with the chain that the NFT exists on.

  • Update the utils/opensea/sell_nfts.js script's fields

    • START_EDITION - Set the start edition of the collection where you want to start selling NFTs from.
    • END_EDITION - Set the end edition of the collection where you want to stop selling NFTs at.
    • NFT_PRICE - Set the price that will be given to each NFT between START_EDITION and END_EDITION.
    • Opensea URLs - Please note that the script is catering for Mainnet (Polygon), as it is looking at the Opensea production URL. If you need to run tests against Testnet (Rinkeby), then update lines 73 and 78 to testnets.opensea.io instead of opensea.io.

@thepeanutgalleryandco
Copy link
Owner Author

Added a new script utils/opensea/sell_nfts.js script that allows for putting NFTs up for sale in an automated way.

@thepeanutgalleryandco
Copy link
Owner Author

Tests have been run against ERC721 contract on Polygon network. Not 100% sure if this will work with ERC1155, especially if token count is also an option. If this is needed, then users can raise a ticket for an enhancement of this feature.

@thepeanutgalleryandco thepeanutgalleryandco linked a pull request Mar 23, 2022 that will close this issue
@thepeanutgalleryandco
Copy link
Owner Author

Chainsafe Github - https://github.com/ChainSafe/dappeteer

@thepeanutgalleryandco
Copy link
Owner Author

Please note that sometimes, when running the script for the first time, it struggles to download the metamask version. What you will experience is that the script merely finishes, without anything happening. Simply run the script again. On the 2nd or 3rd time, the metamask download will succeed and from there, the script should work every time.

@thepeanutgalleryandco
Copy link
Owner Author

Latest issue seems to be that the v10.1.1 download file is not retrievable by the script, so I needed to manually pull it.

  1. Download repo from https://github.com/MetaMask/metamask-extension/releases/tag/v10.1.1
  2. Copy the file into your repo as node_modules/@chainsafe/dappeteer/metamask/download/metamask-chrome-10.1.1.zip
  3. Extract the zip file into node_modules/@chainsafe/dappeteer/metamask/v10_1_1/
  4. Attempt to run the script again (npm run sell_nfts)

@thepeanutgalleryandco
Copy link
Owner Author

Please remember to unlock the collection for selling by putting an item up for sale initially and paying the unlocking fee, otherwise the script won't work.

@d-3-v-s-k-i
Copy link

Summary

Create a new script that can be used to automate the selling of NFTs for a specific price. As this is the initial script, only need to cater for a single price for all the NFTs that needs to be put up for sale. Script only needs to cater for putting Polygon NFTs up for sale in the initial build.

Basic example

Add a new script that can take a seed phrase to your wallet that contains the NFTs that needs to be put up for sale, a start edition number, an end edition number, a price and a contract address.

StartEdition: 1
[ EndEdition: 10
Price: 0.002 (Above $5, as that is the minimum)
Contract: 0x09aa1a14e572e6fc05f64e541699d3e0361c7f2f

  • - > Seed Phrase: one two ]()@razielll three mountain lion test four five six big small town

Auto login to Opensea with the Seed phrase for the wallet that owns the NFTs that should be sold. Loop through editions 1 through to 10 (both inclusive) on the contract address and put each NFT up for sale if it can find the NFT edition number and your wallet owns it. Should the items be owned by someone else or the edition can't be found, then skip over to the next edition.

Motivation

This will allow users to put their NFTs up for sale automatically by simply running a script instead of manually putting each item up for sale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

2 participants