top of page

Official0xygen MetaMask NFT Integration
Plug-in Documentation

0xG copy 5.2.png

Prerequisites for this version:

  1. REQUIRED: An EVM compatible 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.

  2. REQUIRED: A set of API keys, which can be provided at the sole discretion of Team 0xygen [support@0xygen.io]. Projects will be vetted and you may be asked to verify contract ownership.

  3. 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.

Prerequisites

Developing with the Official0xygen Unreal Engine Blueprints:

0xygen Nodes.png

The Official 0xygen Blueprint nodes are grouped into three primary functions:

evm_edited.jpg

​Blueprints:

  • Sync Wallet

  • Verify Wallet

Data Cloud

​Blueprints:

  • Get Metadata

  • Process Metadata

  • Build Metadata Map

Illuminated Objects

​Blueprints:

  • Update Metadata

A primary function is separated into multiple nodes to give developers increased flexibility and timing control. In general, full utilization of a primary function requires the usage of all of its associated Blueprint Nodes.

Interacting

Wallet Verification

The Wallet Verification primary function is used to confirm that account details are valid. It utilizes two Blueprint Nodes: Sync Wallet and Verify Wallet.

Sync Wallet Node

SyncWallet Node.PNG

The Sync Wallet node is utilized to request confirmation that a given username and password pair is associated with a valid account on the 0xygen server. It creates a Wallet Relay Object to send this request and receive the corresponding response.

INPUT:

  • The Username STRING to be verified as part of a Username/Password pair

  • The Password STRING to be verified as part of a Username/Password pair

OUTPUT:

  • The Wallet Relay Object that has sent the verification request to the server

Verify Wallet Node

The Wallet Verification primary function is used to confirm that account details are valid. It utilizes two Blueprint Nodes: Sync Wallet and Verify Wallet.

Verify Wallet Node.PNG

The Verify Wallet node is utilized to analyze the response received from a Sync Wallet request. It provides confirmation whether a given username and password pair is associated with a valid account on the 0xygen server.

INPUT:

  • A Wallet Relay Object that was created by a Sync Wallet node

OUTPUT:

  • TRUE if the Username/Password pair is associated with a valid account

  • FALSE if the Username/Password pair is NOT associated with a valid account

Wallet Verification Example
The following is an example snippet for how to use all of the blueprint nodes associated with the Wallet Verification primary function in conjunction. It utilizes a Check Relay Response Loop (detailed below):

Check Relay Example.PNG

Obtaining NFT Metadata

The Obtaining NFT Metadata primary function is used to pull the NFT Metadata associated with user account(s) from the Blockchain into your Unreal Engine project. It utilizes three Blueprint Nodes: Get Metadata, Process Metadata, Build Metadata Map.

Get Metadata Node

Get Metadata.PNG

The Get Metadata Wallet node is utilized to request the metadata of all NFTs that are from a given API key and owned by a provided list of users. It creates a Metadata Relay Object to send this request and receive the corresponding response.

INPUT:

  • The API Key of the NFTs as a STRING

  • The Users to be checked as an ARRAY of Username STRING

OUTPUT:

  • The Metadata Relay Object that has sent the request to the server

Process Metadata Node

Process Metadata Node.PNG

The Process Metadata node is utilized to analyze the response received from a Get Metadata request. It organizes the NFT metadata into several mappings that can be searched for specific values.

INPUT:

  • A Metadata Relay Object that was created by a Get Metadata node

OUTPUT:

  • The Username to TokenID Map

    • The Map Key a valid Username as a STRING. This should be one of the usernames provided in the Users input array of the associated Get Metadata node

    • The Map Value is a comma-separated list of TokenIDs associated with the Username Key given as a single STRING. Can be parsed into an array with the comma delimiter ‘,’

  • The TokenID to Metadata Map

    • The Map Key is valid TokenID as a STRING. This should be one of the usernames provided in the Users input array of the associated Get Metadata node.

    • The Map Value is the NFT metadata JSON given as a formatted STRING. Can be parsed into a map with the Build Metadata Map node

  • The All Returned TokenIDs Array

    • STRING Array of all TokenIDs returned in the response.

Build Metadata Map Node

Process Metadata Node.PNG

The Build Metadata Map node is utilized to parse a NFT Metadata JSON from a TokenID to Metadata Map value into a map of trait/value pairs that can be easily searched.

INPUT:

  • An NFT Metadata JSON formatted as a STRING. These are stored as the Values of the TokenID to Metadata Map output by the Process Metadata node.

OUTPUT:

  • A STRING/STRING Map of the trait/value pairs of the NFT

    • Map Key is the NFT Trait as a STRING

    • Map Value is the Value of that NFT Trait as a STRING

Obtaining NFT Metadata Examples

 

The following is a series of example blueprint snippets that go over some of the various use cases of the Obtaining NFT Metadata primary function. 

 

Get and Process Metadata of an array of Users on an API Key (utilizes a Check Relay Response Loop as detailed below:

Obtaining NFT Metadata Example.PNG

Build Array of all NFTs owned by a specific User:

Build Array Example.PNG

Build Metadata Map of Specific NFT:

Build Metadata Map Example.PNG

Build Metadata Map of all NFTs owned by a specific user:

NFTs Owned by a specific user Example.PNG

Build Metadata Map of every returned NFT:

Every returned NFT example.PNG

Find the Value of Specific trait in an NFT Metadata Map:

Specific Trait Example.PNG

Updating Dynamic Metadata

The Updating Dynamic Metadata primary function is used to alter the trait and value metadata of existing dynamic NFTs. Contact the 0xygen team to discuss the Updating Dynamic Metadata feature, which requires special setup for your metadata storage and retrieval.

Update Metadata Node

Update Metadata Node.PNG

The Update Metadata node is utilized to update dynamic NFT metadata to the input values. It creates an Update Relay Object to send this request. Currently, there is no need to receive the response.

INPUT:

  • Special API Key associated with the NFT dynamic collection as a STRING

  • TokenID of the NFT as a STRING

  • Trait Types of the NFT Metadata as an Array of STRINGs

  • Trait Values of the NFT Metadata as an Array of STRINGs

  • NFT Name as a STRING

  • NFT Description as a STRING

  • NFT Image URL as a STRING

  • NFT External URL as a STRING.

OUTPUT:

  • The Update Relay Object that has sent the verification request to the server

Server Communication

Several of the Blueprint Nodes communicate with the Official 0xygen external server. This communication requires two components: Relay + Delay as previously noted in the examples. This section does a deep dive into how these work.

Relay

Server communication utilizes an object called a Relay. A Relay can be thought of as a “Request/Response instance”.

Some Nodes (such as Get Metadata) create a Relay when they make a request to the server. This Relay is a return object of that node.

 

Other Nodes (Such as Process Metadata) take an existing Relay object as input. They then can access the server’s response to that Relay’s request.
 

Relay img.PNG

In order to prevent accidental miswiring of non compatible nodes, these relay types do not work with nodes outside of their primary function. The one exception to this is the Check Relay Response node which accepts any Relay type as input.

01

Wallet Verification

Wallet Relay

02

Obtaining NFT Metadata

Metadata Relay

03

Updating Dynamic Metadata

Update Relay

Why Delay?

It takes a bit of time to contact the blockchain, retrieve metadata, and do backend processing. This creates a small delay between the sending of a request and the receipt of its associated response. It is important to ensure a response is received before utilizing its content (otherwise you’ll be working with empty/incorrect data).

There are two methods that can be utilized to help ensure a response is received before it is accessed: the Official 0xygen Check Relay Response node (recommended) and Manual Delay.
 

Check Relay Response Loop (Recommended)

Check Relay Response.PNG

The Check Relay Response node is utilized to check if a Relay has received a response.

INPUT:

  • A Relay Object that has sent a request to the server

OUTPUT:

  • TRUE if the Relay Object has received a response

  • FALSE if the Relay Object has NOT received a response

The Check Relay Response node is utilized as part of a loop to repeatedly check for a response before moving on to the next node:

Loop example.PNG

The Delay between loops is recommended to be set at 0.5 seconds to balance speed and performance. It should be adjusted/optimized as desired.

Be sure that the Response Received Boolen variable is always set to FALSE before entering the loop.

Manual Delay (Not Recommended)

If desired, developers can simply set a manual delay between the sending of a request and the utilization of its response. This should be used at your own risk as it does NOT guarantee the response has been received before use.

image.png
Creation
cog background (1).png

Gamer Account Creation Process:

  1. Navigate to: https://www.portal.0xygen.io/register and sign up with a new unique Username, Email, and secure password.

p1.png

2. User will be prompted to login with the new account then will be taken to a simple dashboard:

p3.png
p2.png

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.

p5.png

4. After you or the gamer links a wallet, it will show the wallet address in the simple Dashboard.

p6.png

The 0xygen Team is here to help and discuss with your team if 0xygen is the right blockchain tool for your project. 

 

EMAIL: support@0xygen.io

Connect with us in our Q and A at our Disord.

Connect with us at the Official0xygen Twitter. 

Blank 1080 x 1920 copy.png
  • Twitter
bottom of page