How to programmatically create new items under a collection
Is it possible to programmatically create new items under a collection without owning and deploying a smart contract? Basically, I'd like to automate the "Create" -> "Submit NFTs" -> "Add New Item" workflow on the UI programmatically, and I'm wondering what the best way of doing this is.
If I do have to own and deploy my own smart contract to achieve my goal, could you give some guidance on how best to achieve this goal?
I'm also interested in knowing more about this...
Definitely interested in this, is this even possible to do programmatically at the moment?
Also interested in this. Is that possible? @alexanderatallah @taylorjdawson @DJViau
Thanks guys for awesome product, btw =)
I haven't found an official way to do this but the below flow works for me. I don't want to share my code yet because it's a huge mess and took me a while. But to point you in the right direction go through the creation process and capture the network calls in your browser. It basically boils down to:
-
Make an unauthed POST request to
https://api.opensea.io/graphql/using thechallengeNonceQueryquery and passing in your wallet address to get a nonce. -
You will need to sign a message with your web3 wallet using the nonce to get a signature - you usually do this via the MetaMask popup. You can automate the signing using web3js, see
web3.eth.accounts.sign(data, privateKey). Passing this signature to the same graphql endpoint usingauthLoginMutationwill give you a JWT auth token. -
Using the above JWT token you make a request to the same endpoint using
collectionManagerAssetCreateMutationand attaching your media.
I'd like to know the answer as well
Also, using Selenium works like a charm :)
I haven't found an official way to do this but the below flow works for me. I don't want to share my code yet because it's a huge mess and took me a while. But to point you in the right direction go through the creation process and capture the network calls in your browser. It basically boils down to:
- Make an unauthed POST request to
https://api.opensea.io/graphql/using thechallengeNonceQueryquery and passing in your wallet address to get a nonce.- You will need to sign a message with your web3 wallet using the nonce to get a signature - you usually do this via the MetaMask popup. You can automate the signing using web3js, see
web3.eth.accounts.sign(data, privateKey). Passing this signature to the same graphql endpoint usingauthLoginMutationwill give you a JWT auth token.- Using the above JWT token you make a request to the same endpoint using
collectionManagerAssetCreateMutationand attaching your media.
Always getting {"errors":[{"message":"[401] Not authorized.","locations":[{"line":9,"column":5}],"path":["auth","login"]}],"data":null}
Probably signing issue ?
Hey @esteban-OpenSea I assume this is because now there's an official way to do it and not just inactivity, right? (or maybe just a joke given it's April 1st...)