Gaming sdk


Subscription is a payment charged periodically


To create your own subscription, first deploy the category smartcontract

  contract MyGameBattlePass is InventoryCategoryNFT {
      string public override name = "Battle passes";
      string public override description = "Battle passes";
      string public override imageUrl = "";

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

  contract MyGameMonthlyBattlePassItem is SubscriptionNFT {
      string public override name = "Monthly pass";
      string public override description = "Monthly battle pass";
      string public override imageUrl = "";
      address[] public override categories = [0xf20e05E89758Cc985E7d80d33F2f6D8573A17827];
      bool public override transferable = false;
      uint256 public override price = 10 * 10**18;
      uint256 public override period = SubscriptionPeriod.Monthly;
      address public override payToken = 0x2A24CC451ca8Ab8A77EcD7483080E3Dce47B8578;
      LootboxMode public override mode = LootboxMode.BOX;
      address[] public override itemsInside = [
      address[] public override amounts = [150, 1, 1];

After contract deployment user can request subscription creation

const userInventory = await gamingSdk.user.current.subscriptions.create(SUBSCRIPTION_ITEM_ADDRESS, 1);