Official0xygen MetaMask NFT Integration
Updated: 07.30.2022 11:14am EST
Follow the brief directions there and return here when you're done!
OPTIONAL: If you want to test with your own demo gamer account you can:
Go to: https://etherscan.io/address/0x0fd3b326ddecf9ea4c3b01be0508ffb7f0acba46#writeContract
Click Connect to Web3
Connect your MetaMask Wallet
Click safeMint, copy-paste your public MetaMask address.
Click Write. There will be a small Ethereum Network gas fee to mint the sample NFT. If you do not wish to pay the fee charged by the Ethereum Network, you can use the demo account info from the Github link.
Gamer Account Creation Process:
Navigate to: https://www.portal.0xygen.io/register and sign up with a new unique Username, Email and secure password.
2. User will be prompted to login with the new account then will be taken to a simple dashboard:
3. Clicking the CONNECT TO METAMASK button in the web portal will open a Signature Request in your Metamask browser extension to verify your account.
4. After you or the gamer links a wallet, it will show the wallet address in the simple Dashboard.
Prerequisites for your own smart contract:
REQUIRED: An Ethereum Mainnet NFT Contract that has the following properties:
IERC-721: All ERC-721 compliant NFT contracts contains contain this core functionality.
IERC721Metadata: Almost every contract will contain this functionality.
IERC721Enumerable: Many contracts will contain this and it is needed for retrieving tokens contained in a gamer’s wallet.
REQUIRED: A set of API keys, which can be provided at the sole discretion of Team 0xygen [email@example.com]. Projects will be vetted and you may be asked to verify contract ownership.
RECOMMENDED: For testing purposes, it is recommended that you have a Metamask wallet with browser extension installed (https://metamask.io/) that owns at least one NFT from your collection.
Interacting with Unreal Engine Blueprints:
1. Let’s start by Using the Synch Wallet and Verify Wallet nodes to log in the user account we just created!
2. Make sure to add a slight delay to allow the server to verify the Wallet
3. Add a branch. If False, we will not proceed as the Email and password do not match:
If True, we will then proceed to sync the metadata for the gamer’s account.
4. Let’s next use the Get Metadata and Process Metadata nodes to obtain the gamer’s NFTs for your contract!
A. Create an Array of Strings var named Users and add the email address for the account we just created
(for testing purposes).
B. Connect the Users var to Users input and enter Api Key.
Note: Api Keys are provided by Team 0xygen who can be reached at: firstname.lastname@example.org
5. Make sure to add a delay of 5-7 seconds, as this node is querying the blockchain and we need to allow for the blockchain to respond.
6. Create a Process Metadata node and connect the pins as shown.
7. The below blueprint will allow you to use the Build Metadata Map node. The For Each Loop will process the metadata for all NFTs owned by the user! Of course, there are many other possible ways to obtain just the first NFT, or a specific NFT.
Note: More tutorials will be provided soon.
8. From the Build Metadata Map node you can look up any NFT variable present in the json metadata for your ERC-721 NFT contract!
9. In this example I am calling the tokenId trait and Eyes trait for two NFTs I own:
10. Output is below, but these traits can easily be mapped to .fbx files and more as implementation is truly flexible!
The 0xygen Team is here to help and discuss with your team if 0xygen is the right blockchain tool for your project.
Connect with us in our Q and A at our Disord.
Connect with us at the Official0xygen Twitter.