Welcome to the AINFT Mobile App GitHub repository. This repository contains the code for an Android/iOS app that allows users to seamlessly interact with AINFT avatars and manage their semi-custodial crypto wallet. Users can log in using various social logins like Google and Facebook, receive a small amount of tokens to cover gas fees, mint avatars, and interact with them. Additionally, users can copy their wallet address and export the passphrase to import the wallet into MetaMask for trading avatars on OpenSea or other marketplaces.
- What is an AINFT Avatar?
- AINFT Smart Contract
- Distribute Tokens Smart Contract
- MintNft Unity Script
- OpenAIChat Unity Script
- NFTStorage.js Script
An AINFT avatar is a digital representation of a person or historical figure created using advanced artificial intelligence and blockchain technology. These avatars are more than just images; they encapsulate the essence of individuals, including their appearance, voice, mannerisms, and stories. Here's what you need to know:
- Digital Time Capsules: AINFT avatars serve as digital time capsules, preserving memories and identities for future generations.
- Personal Legacy: They enable descendants to interact with avatars of their ancestors, gaining insights into family histories and forging a sense of continuity.
- Historical Figures: AINFT avatars can bring historical figures to life, offering personalized interactions and immersive learning experiences.
- Companionship: In an increasingly isolated world, these avatars provide companionship and connection, offering solace and conversation.
- Continuous Learning: They redefine learning by enabling conversations with experts, like Einstein, and facilitating continuous growth.
- Entertainment: Artists and celebrities can create avatars for unique fan interactions, revolutionizing entertainment.
- Cultural Heritage: AINFT avatars preserve cultural traditions and ensure their accessibility and appreciation on a global scale.
- Generational Understanding: They bridge generational gaps by encouraging empathy, dialogue, and shared connections.
To dive deeper into the fascinating world of AINFT avatars, read the full article.
contracts/AINFT.sol
- Name: AINFT
- Inheritance: ERC721Enumerable, ContextMixin, NativeMetaTransaction, Ownable
- Description: This smart contract represents the AINFT avatars. Users can mint new avatars and check their balance.
- Functions:
mintItem(string memory tokenURI): Allows users to mint a new avatar with the given token URI.getBalance(address wallet): Returns the balance of avatars owned by a specific wallet.getTokensOfOwner(address owner): Returns the avatars owned by a specific owner in JSON format.
- The
mintItemfunction is used to mint new avatars with a token URI. - The
getBalancefunction returns the balance of avatars owned by a specific wallet. - The
getTokensOfOwnerfunction returns the avatars owned by a specific owner in JSON format.
// Mint a new avatar
uint256 newItemId = mintItem("https://tokenURI.example/avatar123");
// Check the balance of avatars owned by a wallet
uint256 balance = getBalance(walletAddress);
// Get the avatars owned by an owner in JSON format
string memory tokens = getTokensOfOwner(ownerAddress);contracts/Distributor.sol
- Name: Distributor
- Description: This smart contract allows the owner to distribute tokens to other addresses.
distribute(address payable _recipient): Allows the owner to distribute tokens to the specified recipient.withdraw(): Allows the owner to withdraw the contract's balance.
- The
distributefunction is used by the owner to distribute tokens to a recipient. - The
withdrawfunction is used by the owner to withdraw the contract's balance.
// Distribute tokens to a recipient
distribute(recipientAddress);
// Withdraw the contract's balance
withdraw();web3auth-unity/Assets/Scripts/Web3Auth/MintNft.cs
The MintNft Unity script allows users to log in, mint AINFT avatars, and check their avatar balances. It interacts with the AINFT smart contract on the Ethereum network.
login(): Initiates the login process using social logins like Google.onLogin(Web3AuthResponse response): Handles the user's login response and initializes the Web3 instance.mintNft(): Mints a new AINFT avatar.GetTokensOfOwner(): Retrieves the avatars owned by the user.ProcessSentenceQueue(): Processes sentences for speech synthesis.
// Login with Google
login();
// Mint a new AINFT avatar
mintNft();
// Get avatars owned by the user
GetTokensOfOwner();web3auth-unity/Assets/Scripts/AiNft/OpenAIChat.cs
The OpenAIChat Unity script enables users to engage in a conversation with an AI character, Aurelia Everwood. It utilizes the OpenAI GPT-3.5 model to generate responses and offers speech synthesis capabilities for a more immersive experience.
SendMessage(string message): Sends a message to the AI character and processes responses.ProcessSentenceQueue(): Manages the queue of sentences for speech synthesis.TrimConversationContext(): Ensures the conversation context does not exceed the maximum length.initialGreeting(): Initiates the conversation with an initial greeting.setVoiceConfig(string voice): Sets the voice configuration for speech synthesis.
// Send a message to the AI character
SendMessage("Hello, Aurelia!");
// Set the voice configuration
setVoiceConfig("en-US_AllisonV3Voice");
// Start the conversation with an initial greeting
initialGreeting();nft-storage/upload-script.js
The NFTStorage.js script is used to upload NFT files and generate metadata for AINFT avatars. It utilizes the NFT.Storage API to store files and metadata on IPFS.
uploadNFTFiles(): Uploads NFT files (GLB and JPG) and generates metadata for avatars.readJSONFile(filePath): Reads the content of a JSON file.
// Upload NFT files and generate metadata
uploadNFTFiles();This documentation provides an overview of the key components in the AINFT Mobile App GitHub repository. Developers can use this information to understand and work with the codebase for building and improving the AINFT mobile application.

