Gaming sdk
Skins

Overview

Skin is an item that can be connected to inventory items and customise them

Skins

To create your own skin, first deploy the category smartcontract

  contract MyGameSkin is InventoryCategoryNFT {
      string public override name = "Skins";
      string public override description = "Game skins";
      string public override imageUrl = "http://example.com/skins.webp";
  }

Once category NFT is deployed, it's address is used as category identifier. Then you need to deploy the skin NFT

  contract MyGameWeaponSkin is SkinNFT {
      string public override name = "Weapon skin";
      string public override description = "Gold weapon skin";
      string public override imageUrl = "http://example.com/gold_weapon_skin.webp";
      address[] public override categories = [0xA7c81c7c10be53974510911F44AF976c7D0709D9];
      // Can be bound only to the items of this category
      address public override boundToCategory = 0x78541Ea822b32c98C00c7C1620A6cF4b65d45762;
      bool public override transferable = true;
      bool public override reboundable = true;
  }

After contract deployment you can mint a skin for user

  await gamingSdk.user.skins.mint(USER_ADDRESS, WEAPON_SKIN_ADDRSS, 1, BOUND_TO_ITEM_ADDRESS);

Skins can be rebound to other items

const userInventory = await gamingSdk.user.current.skins.rebound(SKIN_ADDRESS, BOUND_TO_ITEM_ADDRESS);