Last active
February 26, 2022 18:58
-
-
Save Niweera/f433d570df40918d870b522406abde5f to your computer and use it in GitHub Desktop.
Upload image to OpenSea
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const createAssetURL = `https://opensea.io/collection/${config.COLLECTION_NAME}/assets/create` | |
const uploadImage = async (page, filepath) => { | |
await page.bringToFront(); | |
await page.goto(createAssetURL); | |
await page.waitForSelector("#media"); | |
const elementHandle = await page.$("#media"); | |
await elementHandle.uploadFile(filepath); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment