Easy NFT Authentication With Mirror World Smart SDK
Rage Effect's AAA Metaverse brought to life with Mirror World
During the collaboration with Rage Effect, we were surprised to see how Rage Effect used the Mirror World Smart SDK to combine NFT with the game experience to enhance the gamer's experience and significantly reduce the development cost from 4 weeks to 1-2 days.
Today let us briefly share with you how Rage Effect uses the Mirror World Smart SDK.
Rage Effect is a AAA-quality community-driven PvP and PvE FPS based on the Solana blockchain, and is developed using Unity as the game engine.
In Rage Effect's game design, they will have a large range of cosmetic NFTs available. These NFTs can't be lost in-game, and they can only be traded on third-party marketplaces. NFT types included but not limited to exclusive skins, camouflages, vehicle and weapon decorations, as well as badges and other accessories.
If a player wants to actually unlock a weapon or armour a skin in the game, they need to buy or trade the corresponding NFT to unlock it.
But then the question arises, how to identify the player has the NFT and verify it? After a lot of research, Rage Effect quickly chose to use Mirror World Smart SDK. Here's how Rage Effect works:
First, Rage Effect need to retrieve the wallet address of the authenticated player. Then, using the Mirror World's "Fetch Multiple NFTs Data by Owner Addresses" API, which can fetch all the NFTs in the user's wallet.
Finally, they check if Rage Effect weapon skin NFT contract address is among the fetched NFT contract addresses, and if it is, they unlock the weapon and armour skins in Rage Effect’s Weapon Workshop.
The above logic is achieved by the following codes:
Code Part (NFT Fetch) :
async void Start(){
string response = await GetNfTsOwnedByAddressAPIs("Your_Wallet_Address");
Debug.Log("Response :\\n" + response)
}
public async Task<string> GetNfTsOwnedByAddressAPIs(string walletAddress){
using (var httpClient = new HttpClient()){
using (var request = new HttpRequestMessage(new HttpMethod("POST"), "<https://api.mirrorworld.fun/v1/devnet/solana/nft/owners>"){
request.Headers.TryAddWithoutValidation("x-api-key", "your-api-key");
request.Content = new StringContent(Body.Content(walletAddress));
request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json");
HttpResponseMessage response = await httpClient.SendAsync(request);
return response.Content.ReadAsStringAsync().Result;
}
}
}
public class Body
{
public string[] owners{ set; get; } ={ };
public int limit{ set; get; } = 0;
public int offset{ set; get; } = 0;
public Body(string[] owners, int limit, int offset){
this.owners = owners;
this.limit = limit;
this.offset = offset;
}
public static string Content(string walletAddress){
Body body = new Body(new string[]{ walletAddress }, 0, 0);
return JsonConvert.SerializeObject(body);
}
}
API Response
{
"data": {
"nfts": [
{
"mintAddress": "HQuZjnjeGzEfRupShRE42LGs6LEgqsZ6v4YRZzT9j4gU",
"name": "Toxic Weapon Skin",
"sellerFeeBasisPoints": 1000,
"updateAuthorityAddress": "CGJkw6Tgb63QcGzm3dXuFtF84DVcimNEaFmdA8Grk4Hn",
"description": "Buy the NFT to unlock this skin in your Shop, which can then be used by selecting it in Customizer.",
"image": "<https://www.arweave.net/dUjxCN9xaAF1jDSDc1iFh_Fm6zihw3FgWLnaEq9I6_U?ext=png>",
"externalUrl": "",
"creators": [
{
"address": "CGJkw6Tgb63QcGzm3dXuFtF84DVcimNEaFmdA8Grk4Hn",
"verified": true,
"share": 100
}
],
"owner": {
"address": "CGJkw6Tgb63QcGzm3dXuFtF84DVcimNEaFmdA8Grk4Hn"
},
"listings": [],
"collection": null
}
]
},
"code": 0,
"error": "",
"status": "success"
}
Of course, this is only a very small scenario of Rage Effect using Mirror World Smart SDK, there are other features in development and we would love to continue to share with you how different customers are using Mirror World Smart SDK to help developers better understand and use our tools to their fullest potential and value.
Read More Showcase:
Build your application with Mirror World Smart SDK :
✅ Smart Auth: All-in-one Login & Authentication
✅ Smart Marketplace: Easily Build Mobile NFT Marketplace
✅ Smart Wallet: Mobile In-App Wallet Integration
✅ Smart NFT Creation: Zero-Code Launch Your NFT
Website | Documentation | Github | Youtube | Blog | Twitter | Telegram