I’m creating a wallet that is meant to be packaged as an NFT and sold to users. The very first principal to log into the wallet will be assigned as the canister controller for both the front end canister and the backend canister of the wallet. I need a way to verify that the first principal logging into the wallet is indeed the owner of the NFT. To do that, I’d need the NFT token metadata (specifically, the owner).
My question is: how do i access token metadata for tokens minted via entrepot? Thank you.
I believe you can use
bearer(token : TokenIdentifier)
That will return the
AccountIdentifier of the owner if the token exists.
I believe Toniq is still working on their metadata approach so I don’t know much about that.
whats the canister id for the canister where this method lives?
Each NFT canister deployed on Entrepot should have this method.
Hey Jesse, feel free to DM me on Twitter @BobBodily and I can walk you through checking NFT ownership. Not too hard. For posterity, here is general approach right now.
- Have user login with wallet. This means they have signed that they own a particular principal.
- Grab subaccount 0 from the principal to get the main wallet address
- Use the tokens_ext (method name for EXT V1) method on that wallet address to get the owned tokens. This will return the tokens they own, and you know they own it because they signed to login with their wallet.
Thanks a bunch @bob11. Where can i find the canister id where the
tokens_ext() method exists?
Also, what’s the best way to establish a line of communication with the team regarding releasing an NFT collection?
Edit: i had to think about it a bit more. Let me know if I’m understanding correctly. Here goes:
When i create the NFT collection, a canister will be created corresponding to that collection. That canister will feature a
tokens_ext Function which I’ll use to get a list of the tokens owned by the account identifier that i input into the
tokens_ext function as an argument. Then with that list, i can check to confirm that the user is the rightful owners of the NFT.