Metadata for TRAIT Wallet
Intro
TRAIT Wallet is a publicly available wallet for playes. It supports all features of TRAIT blockchain including metadata of on-chain entities. This allows game developers to configure display of blockchain tokens in the wallet.
Demo account in TRAIT Wallet
When you launch the TRAIT Wallet at the first time or when you open the screen with the list of accounts - you see the button "Add a demo account". If you do this - a new account will be added. This account has some balance of fungible tokens and NFTs. You can see them all on the main screen of the wallet.
To display these tokens to the users the TRAIT wallet does the following:
requests account balances via DataGate API;
requests (via DataGate API) metadata URLs for all on-chain entities that are owned by the account: NFTs (and corresponding NFT Collections), Fungible tokens, AppAgents that own fungible tokens and NFT Collections;
fetches metadata JSON files;
validates and parses metadata JSON files;
extracts required information such as name of on-chain entities, URLs to images etc.
displays all information to the user;
As you can see there are two sources of information for the wallet:
Blockchain (through DataGate API) provides balances and URLs to metadata files;
Metadata files provides all the rest;
Metadata for demo account
All information for demo account is stored in the GitHub repo: link.
folder
aws_s3_assets
contains the JSON metadata files and media files;folder
.github/workflows
contains the configuration for GitHub CI to automatically copy files fromaws_s3_assets
to AWS S3 bucket;folder
py_tests
contain code to validate the metadata files and deployment to the AWS S3 bucket;folder
deploy
contains TypeScript code to automatically create blockchain entities (AppAgents / NFTs / Fungible tokens) and set their metadata URLs. This can be a good starting point if you seek to automate creation of blockchain tokens;
This repository provides an example of how to provide information to the TRAIT wallet via metadata & traits.
It also demonstrates high power of traits. With just a github repo and AWS account you can setup any number of blockchain tokens and users will be able to properly see and transfer them via the wallet. Any game can get a great wallet for their on-chain tokens with almost no effort!
Last updated