Skip to content

OpenSear is a system that helps me to mint and list my NFTs on opensea.io marketplace.

License

Notifications You must be signed in to change notification settings

Niweera/opensear

Repository files navigation

DeepSource

OpenSear is not maintained anymore. The opensea.io platform has added Google reCAPTCHA verification when creating NFT assets to deter automated minting of NFTs. I am not that good to circumvent Google reCAPTCHA 😂.

OpenSear

OpenSear is a system that helps me to mint and list my NFTs on opensea.io marketplace.

The story behind the OpenSear system is discussed in three part limited article series. Read it from the following links.

How I Automated Minting My Tweets as NFTs on OpenSea

How I Automated Minting My Tweets as NFTs on OpenSea — Part 2

How I Automated Minting My Tweets as NFTs on OpenSea — Part 3

Check out my NFT collection a wordle a day keeps the sadness away.

image

Architecture

OpenSear is consisted of two separate systems, OpenSear-API (opensear) and OpenSear-Worker (opensearobot). The following is a high-level architecture of OpenSear system.

image

When a user tweets a specific tweet (in this case a tweet of a wordle), the webhook created using Twitter Account Activity API will send the payload to OpenSear-API. The OpenSear-API will queue a job in a Redis server using Bull and OpenSear-Worker will be notified of this job.

OpenSear-Worker will obtain a screenshot of the tweet (notified via the webhook payload) using TweetPik Twitter Screenshot API. The TweetPik screenshot has a watermark (luckily it's position is predictable) and the watermark is removed using Jimp library. Then the watermark removed tweet screenshot is ready for minting an NFT and listing on OpenSea.io platform.

Since OpenSea.io platform does not have an API for creating assets, the puppeteer will automate the task and mint the NFT. The OpenSear-Worker will launch a puppeteer browser, and it will be authenticated for MetaMask using @chainsafe/dappeteer and finally the NFT is minted. Finally, OpenSear-Worker will reply the original tweet with the OpenSea.io marketplace asset URL for the minted NFT. This is where the OpenSear-Worker concludes its tasks. Then I manually list them by quoting a price later 😁.

Install Steps

# Install Xvfb and supported packages
$ sudo apt-get install -y xvfb libgbm-dev libxkbcommon-x11-0 libgtk-3-0
$ npm install

Start OpenSear-API

$ pm2 start --name "opensear" npm -- start

Start OpenSear-Worker

$ pm2 start --name "opensearobot" npm -- run worker

OpenSear in action

image

image

Acknowledgement

Special thanks to all the people who wrote code that I took some inspiration 😉. Specially this guy for his wonderful article and code.

No idea what NFTs are? Me neither 🤷‍♂️. Check this video out.