Opensea ERC-1155 proof of ownership

137 views Asked by At

I'm creating a web3.0 project where I need to know if the user has a specific token in their wallet to provide access to content.

The collection was created in opensea, was lazy minted, and the contract is ERC-1155 provided by opensea.

My question is, based on Opensea is the owner of the contract, how can I determine if the asset hold for the customer is the one in the collection?

2

There are 2 answers

0
Mikko Ohtamaa On
0
Iulian Novenschi On

You can determine if a wallet holds an NFT or not using Moralis NFT API.

Here is an example step-by-step: https://docs.moralis.io/web3-data-api/evm/how-to-get-all-nfts-owned-by-an-address.

Also here is a guide on how to build a protected webpage that only an owner of an NFT can access: https://docs.moralis.io/example-dapps/evm/token-gating-website-nextjs.

Disclosure: I work at Moralis