Only this pageAll pages
Powered by GitBook
1 of 25

Developer Documents

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

API reference

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

OPENSOURCE PROJECTS

Loading...

Loading...

NFT Data

Easily access NFT data from any EVM chains

ZooGames provides the opportunity to integrate any NFT collection from most EVM chains.

Currently, we offer a manual process for adding your NFT collection to our platform, and we are actively developing a fully autonomous solution.

If you're eager to get started, please contact us and provide the following information: the EVM chain, contract address, and token name (alias name) of your NFT collection.

Once your collection is added to our system, we will provide you with an API endpoint to access and utilize the collection within ZooGames.

Introduction

The Definitive Guide to Harnessing the ZooGames API

Welcome to ZOOGAMES

The ZooGames API enables communication between your game and the blockchain. It allows you to create in-game transactions using vZOO tokens, retrieve NFT data regardless of the original chain, implement a simple and secure authentication system, and mint in-game chips or NFTs.

The protocol is constantly evolving, and we are working on several features such as cross-chain messaging (interacting with a target chain through the ZooGames API) and the integration of your gaming token into our ecosystem for a simple and free system.

By seamlessly integrating with all EVM networks, ZooGames offers users the freedom to connect, play, and earn across a range of networks such as Ethereum, Binance Smart Chain, Avalanche, Wanchain, and more.

With ZooGames, players have the flexibility to choose their preferred network and connect using their primary address (learn more) or using an innovative social login, which serves as their gateway to the platform. Additionally, users can link multiple secondary addresses to consolidate and manage their owned NFTs from any EVM chain. The platform allows the creation of multiple secondary addresses to cater to individual needs.

Once connected, the ZooGames protocol automatically generates a unique mirror address (Gaming Wallet) exclusively for gaming purposes. This mirror address, created on the Wanchain network, acts as a replica of the user's primary address (and any linked secondary addresses) and facilitates seamless participation within the gaming environment.

ZooGames empowers players with a versatile and interoperable gaming experience, where blockchain technology enhances security, transparency, and ownership of in-game assets.

With the addition of the Instant PlayPass feature, players can now dive straight into the action without the initial setup of a ZooGamesID.

Want to jump right in?

To get started, please install the ZooGames SDK and familiarize yourself with the functionality of our Game Settlement API available here.

Quick Start

API Endpoint

TESTNET/MAINNET

For your projects, we provide two different API endpoints based on the network you intend to utilize:

Mainnet API Endpoint

This endpoint is specifically designed for integration with the mainnet network. It enables you to interact with the ZooGames API in a production environment, where real transactions and operations occur. You should use the Mainnet API Endpoint when your project is ready for deployment and needs to interact with the live blockchain network.

https://api-mainnet.zoo.games/api

Testnet API Endpoint

This endpoint is intended for use on the testnet network. The testnet environment allows you to experiment and test your integration with the ZooGames API without utilizing real funds or affecting the live blockchain network. It provides a sandbox-like environment for developers to ensure the functionality and reliability of their applications before transitioning to the mainnet.

You can request Testnet vZOO here

https://api-testnet.zoo.games/api

Please ensure that you select the appropriate API endpoint based on your project's requirements and the desired network environment.

We recommend testing on the Testnet environment first. Throughout the documentation, we use "API_END_POINT_URL" to represent the API Endpoint you choose to use. Replace it with the appropriate Testnet or Mainnet URL as needed.

Users Status

Track and retrieve the status of all players in your game

ZooGames provides a status feature that allows you to update and track the status of players in your game. With this functionality, you have the flexibility to monitor and display the real-time status of players to enhance the gaming experience. This feature can be seamlessly integrated into your game, your website or your mobile application and will be also visible on the Zoo.Games platform.

Once the "isPlaying" parameter is set to "true", the system will automatically switch the player's status to "Offline" after 30 minutes of inactivity. It is recommended to update the player status every 10 minutes to keep it up to date.

Conversely, when the "isPlaying" parameter is set to "false", the offline status will be reflected in the system after a delay of 3 minutes. This ensures that the status accurately represents the player's online or offline presence.

Set user status

Optionally, you can add a note while setting up the player status. This note will provide an extra epic experience for your players. Here are some note examples:

  1. Mastering the art of virtual sword fighting!"

  2. "Embarking on an epic quest to save the kingdom."

  3. "Exploring uncharted territories in search of hidden treasures."

  4. "Unleashing magical powers to vanquish foes."

  5. etc.

Set user status

GET API_END_POINT_URL/api/analytics

Request Body

Name
Type
Description

We recommended you to use gameName as the Game ID you have registered to able to detect by our system to show status of Online/Offline on Zoo.games

The payload cannot exceed 50kb Usernames and game names must be unique records. Inactive records will be deleted after 1 year.

Get users status

Get users status

GET API_END_POINT_URL/api/analytics?gameName=&isOnline=true

If no query is sent, the system will return all existing records on ZooGames.

Query Parameters

Name
Type
Description

API change log

21/12/2023

  • Add new Game Settlement API

23/10/2023

  • Create an Info of Hotlink to register with reveled redeem code.

16/10/2023

  • Add direct get User's Profile Image

25/09/2023

  • isTMP flag has been changed to isPlayPass

18/09/2023

  • Add Temporary Accounts Features

  • Add isTmp and createdFromRedeemCode to userInfo api

25/08/2023

  • Add Query string "without_avatar" to reduce the size of returning data

    • Users

username*

String

ZooGamesID or any string reference

gameName*

String

You game's name or any string as a reference * Recommended to use gameName as a Game ID that you have registred on Zoo.games

gameVersion

String

Can be any string like V.1.2

gameAddress

Address

Your registered game address

isPlaying

Boolean

Online or Offline status

note

String

A remark

{
"success": true,
}
{
  "success": false,
}

gameName

String

the game name or stat name for retrieval

isOnline

boolean

Display only online or offline users.

{
"success": true,
    "data": [
        {
        "host": "api-testnet.zoo.games",
        "user_agent": "curl/7.87.0",
        "x_vercel_ip_country": "JP",
        "x_vercel_ip_city": "Tokyo",
        "x_vercel_ip_latitude": "35.6897",
        "x_vercel_ip_longitude": "139.6895",
        "x_vercel_ip_timezone": "Asia/Tokyo",
        "timestamp": "2023-06-14T15:20:30.477Z",
        "username": "test2",
        "gamename": "goodGame",
        "gameversion": "unknown",
        "gameaddress": "unknown",
        "isplaying": false,
        "note": "",
        "status": "offline"
        }
    ]
}
{
  "success": false,
}
Over V2
reveal redeem code
user/profile_pic
create temporary accounts
reveal redeem code
userInfo/[username]
userInfo/[primary_address]
userInfo/[username]
userInfo/[primary_address]

Game Trade

Buy or sell in-game items with vZOO

This solution allows users to utilize their vZOO tokens to buy or sell in-game items and assets. The game services and game address play a crucial role in facilitating these transactions and providing control over the process.

Please note that 2FA is mandatory for making Game Trade transactions in-game.

This solution can be applied in various scenarios:

  1. Purchasing In-game NFTs (ERC721) with vZOO:

    • Users can spend a specific amount of vZOO.

    • A new ERC721 token is minted and transferred to the user.

  2. Purchasing In-game Tokens (ERC20) with vZOO:

    • Users can spend a certain amount of vZOO.

    • A new ERC20 token is minted and transferred to the user.

  3. Acting as a middleman for user-to-user trades:

    • Users can transfer vZOO from User A.

    • The gameTrade API is called to facilitate the trade.

    • ERC20 tokens are transferred or burned, and ERC721 tokens are minted or transferred between User B and User A.

    • The gameTrade API is called again to send the locked amount from User A to User B.

In summary, this solution enables the seamless exchange of vZOO, ERC721 tokens, and ERC20 tokens between users, with 2FA verification ensuring secure and authenticated transactions.

fees are incurred for each transaction on the platform. These fees are automatically deducted to generate additional rewards for players. Check the current fee price there.

GameTrade

Initialize ERC721 before using the token

POST API_END_POINT_URL/API_KEY/game/trade

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

username*

String

ZooGamesID of sender or receiver

userPrimary*

Address

Primary Address that is linked to ZooGamesID above

token

String

2FA token to approve spending - If amountUserPay > 0 this one is required

gameAddress*

Address

Address of Game/Project registered Primary Address

amountUserPay*

number

Amount of spending from defined zoogamedID to gameAddress

Can be 0 if you want to switch to mode amountUserGot

amountUserGot*

number

Amount of spending of gameAddress to defined zoogamesID

Can be 0 if you want to switch to mode amountUserPay

itemId

number

it's used as reference and will contain the result for cross-checking purposes

{
  success: true,
  data: {
    success: true,
    txHash: '0xe1226e9929b3eb76bb58ff039c3e1038d70e8e44a2b5b7f8e443d6a48880659b',
    username: 'zoogamesid',
    amountUserPay: 10,
    amountUserGot: 0
    itemId:1 // An extra field for crosschecking
  }
}

You need to keep Token Address for the future usage

{
    success: false;
    message: 'The primary error message',
    data: {
        errors: [
            {
                message: "any error message",
                data: {
                   // Some data properties //
                }
            }
        ];
    }
}

The fields "amountUserPay" and "amountUserGot" cannot be defined together. Only one of these fields can be used. If "amountUserPay" is greater than 0, it is not necessary to enter a token (2FA). This scenario is used when sending vZOO from the gameAddress to the user.

RNG Service

Call randomness to defeat cheaters

Random Number Generator

The RNG service in this gaming API provides randomness for various aspects of the game, ensuring fairness, unpredictability, and security. It adds excitement, prevents bias, enhances game balance, and deters cheating.

Simple Random Number Generator function return with array of HEX number

GET API_END_POINT_URL/API_KEY/random/RNG_LENGTH/RNG_COUNT

Query Parameters

Name
Type
Description

Randomness function + Seed String

You can use Seed String to always generate fixed results.

GET API_END_POINT_URL/API_KEY/random/RNG_LENGTH/RNG_COUNT/SEED_STRING

You can utilize a future Block Hash as a seed to obtain an unpredictable but verifiable random number. The result will always be consistent with the provided seed string.

Query Parameters

Name
Type
Description

Use Cases

  1. Gameplay Mechanics: Many games rely on random elements, such as random encounters, loot drops, critical hits, or chance-based events. The RNG service provides a source of randomness to determine the outcomes of these events, making the gameplay more exciting and unpredictable.

  2. Fairness in Competitions: In multiplayer or competitive games, the RNG service can be used to ensure fairness among players. For example, when determining matchmaking, allocating resources, or deciding turn orders, randomization helps prevent bias or favoritism and creates a level playing field for all participants.

  3. Security and Encryption: Randomness is crucial in cryptographic operations and security protocols. The RNG service can generate random cryptographic keys, initialization vectors, or nonce values, which are essential for encryption, secure communications, and preventing unauthorized access.

  4. Game Balance and Variability: Randomness adds an element of variability to the game, preventing repetitive patterns and creating unique experiences. By incorporating random elements, the game becomes less predictable, enhancing replayability and player engagement.

  5. Anti-Cheating Measures: RNG can be used to deter cheating or exploit attempts within the game. For instance, randomizing critical game values or outcomes makes it harder for players to manipulate or predict results through unauthorized means.

By utilizing an RNG service within the ZooGames API, developers can ensure that the game's outcome is determined in a fair, unbiased, and unpredictable manner. It enhances the gaming experience, maintains game balance, strengthens security measures, and fosters a more enjoyable and competitive environment for the players.

ZooGames AUTH webapp for Telegram

ZooGames’ revolutionary system simplifies gaming authentication

The ZooGames WebApp code is also completely free and open-source, so developers can customize and integrate it into their games and apps without any extra cost or hassle.

In short, ZooGames’ revolutionary system simplifies gaming authentication and offers a secure and easy way to access your gaming data. So, why not give it a try and experience the future of web3 gaming authentication?

Please check out our Github:

Example of use case

You can try accessing the ZooQuiz bot by going to and typing "/register" followed by clicking on "Login". This will bring up the Login WebAPP. You can then provide your ZooGamesID and 2FA token to log in and link your Telegram ID with your ZooGamesID.

Prerequisite

  1. MongoDB can be used to store session records for your game. You can sign up for a free account at to test your game.

  2. For bot development using NodeJS stack, you can utilize "node-telegram-bot-api", which can be accessed at . ()

  3. It is recommended to have some knowledge of Telegram BOT API, which can be found at , () as well as Telegram WebAPP at . ()

  4. To obtain ZooGames API KEY and SECRET, you can request it through Telegram at (Zoo.Games Sub Topic).

  5. The Vercel service can be used to host your WebAPP.

Flow of Authentication

The authentication flow involves the display of a login form on the WebApp. Upon successful connection to the right MongoDB and input of the user's Telegram ID, a JWT Token will be recorded as the following structure:

The user will also receive a direct message from the bot, containing their logged in Zoo.Games ID, Primary Address, and Mirror Address. If there are any errors, an alert will be displayed to prompt the user to fix it.

You can continue writing your BOT code to get TG user id, username and ZooGames JWT for further gameplay.

BOT Code

To call the Telegram Webapp, the sendMessage and sendPhoto APIs can be used with a reply markup of inline_keyboard. It is important to note that the Bot Menu should not be used to call the WebAPP, as it will not send a query of User Data to the WebAPP. The following environment variables structure can be used:

ENV Structure of TESTNET

ENV Structure of MAINNET

API_KEY*

String

API KEY

RNG_LENGTH*

Integer

Length of Hex number

RNG_COUNT*

Interger

Number of returned results

API_KEY*

String

API KEY

RNG_LENGTH*

Integer

Length of Hex number

RNG_COUNT*

Interger

Number of returned results

SEED_STRING*

String

Any String / Block Hash / Reference String from your side

{
    "success": true,
    "data": [
        "689957ac83b4dc6a8c11c61cb9717484",
        "39f1d2aa5f7cef567996e26fd09ccc37",
        "f877260c00449810e5a89442068105a3",
        "0bb6827d0d4d9687e0da04a78cb2c4cc",
        "c5e12dd1ad8b58989883a422cd6ae1d2"
    ]
}
{
    // Response
}
{
    "success": true,
    "data": [
        "324fe8b8a143c83a03131b6d80cb6fe2",
        "5dfeb015a94d0952534c92fd5cc5d6a9",
        "d7c4b41bc0ea88a56bd6cd51f878fcb5",
        "f98855bd84800bb0c0ef7ce9fba09ef4"
    ]
}
{
    // Response
}
_id: 123456abcdefg
network: "testnet"
telegram_id: 123456789
dm_id: 123456789
mirror_address: "0x0000..."
primary_address: "0x0000..."
user_token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImdlbnNoaW1hcm8iL…"
zoo_games_id: "myZooGamesID"
bot.sendMessage(msg.chat.id, 'Please click button below to login', {
    reply_markup: {
        one_time_keyboard: true,
        inline_keyboard: [
            [
                { text: "LOGIN", web_app: { url: process.env.WEBAPP + "/login" } },
            ],
        ]
    }
}
#BOT AND DATABASE
BOT_TOKEN=
DB_URI = mongodb+srv://[Your Mongo crential and endpoint]/?retryWrites=true&w=majority
DB_NAME=MYGame
DB_COLLECTION_USERS=users

#ZOOGAMES
ZG_API_KEY=
ZG_SEC_KEY=
ZG_API_SERVER=https://api-test-serverless.vercel.app
ZG_GAME_ADDRESS=
ZG_APPROVE_AMOUNT=

#NETWORK CONFIGURATION
NETWORK=testnet
EXPLORER=https://testnet.wanscan.org/tx/
#BOT AND DATABASE
BOT_TOKEN=
DB_URI = mongodb+srv://[Your Mongo crential and endpoint]/?retryWrites=true&w=majority
DB_NAME=MYGame
DB_COLLECTION_USERS=users

#ZOOGAMES
ZG_API_KEY=
ZG_SEC_KEY=
ZG_API_SERVER=https://api-beta.zoo.games
ZG_GAME_ADDRESS=
ZG_APPROVE_AMOUNT=

#NETWORK CONFIGURATION
NETWORK=mainnet
EXPLORER=https://www.wanscan.org/tx/
https://t.me/ZooQuiz_bot
https://mongodb.com/
https://github.com/yagop/node-telegram-bot-api
https://github.com/yagop/node-telegram-bot-api
https://core.telegram.org/bots/api
https://core.telegram.org/bots/api
https://core.telegram.org/bots/webapps
https://core.telegram.org/bots/webapps
https://t.me/ZooEcosystem

Users

All about user's info

Get User's Info

The User API serves the purpose of retrieving essential information about a user in the ZooGames API. It provides details such as the user's ZooGamesID, EVM addresses (primary, secondaries and mirror), their respective balances, the chain ID, the number of successful 2FA verifications, the creation time, and an optional avatar. This information can be used for user identification, account management, displaying user profiles, and tracking user activities within the gaming platform

Get Basic Info by ZooGamesId

GET API_END_POINT_URL/API_KEY/userInfo/username/[ZOO_GAMES_ID]

Path Parameters

Name
Type
Description

ZOO_GAMES_ID*

String

ZooGamesId

API_KEY*

String

Api Key

Query Parameters

Name
Type
Description

without_avatar

Boolean

true: To set "avatar" property as "null" to reduce the returning data

{
    "success": true,
    "data": {
        "username": "zoogametester",
        "primaryAddress": "0x2B2A8B3683292442fACa52e9B6537Faaad0AE658",
        "mirrorAddress": "0x224e0CE4F4132eAc88C145b6B294512056BbFE45",
        "mirrorBalance": "55.55",
        "chainId": 999,
        "verify2FASuccessTimes": 3,
        "createTime": 1657088981796,
        "avatar": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAAAAQwAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAAHRyWFlaAAABZAAAABRnWFlaAAABeAAAABRiWFlaAAABjAAAABRyVFJDAAABoAAAAChnVFJDAAABoAAAAChiVFJDAAABoAAAACh3dHB0AAAByAAAABRjcHJ0AAAB3AAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAFgAAAAcAHMAUgBHAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFhZWiAAAAAAAABvogAAOPUAAAOQWFlaIAAAA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6FLtKAa26QQd7YmF58zhdpG7gqp0Ry5F9ugt3uuCQVzei6FbHCQ6rq6upPMbYaPcM+9T1F0a6TogNm0xSEc5syf3ErakS/DsO0Sfme2SLrEpbVQUTQ2lo4YWjkxgb8FlBrRwAHsVUXbIY2bLQPki5REROpEREQhEREIURprUtv1PaYa6imYXuaOth2u1E7m0jjx581LoiEIiIhCIiIQiIiEIiIhCIiIQiIiEKL1DqG36btU1fXzsZsNJjjLu1K7k1o55PlxKIiEL//2Q=="
        "isPlayPass": false, //created with Instant PlayPass or not
        "createdFromRedeemCode": false, // This is optional key
    }
}
{
  "success": false,
  "message": "error message",
  "data" : {username}
}

Get Basic Info by Primary address

GET API_END_POINT_URL/API_KEY/userInfo/primary/[PRIMARY_ADDRESS]

Path Parameters

Name
Type
Description

PRIMARY_ADDRESS*

String

User Primary Address

API_KEY*

String

Api Key

Query Parameters

Name
Type
Description

without_avatar

Boolean

true: To set "avatar" property as "null" to reduce the returning data

{
    "success": true,
    "data": {
        "username": "zoogametester",
        "primaryAddress": "0x2B2A8B3683292442fACa52e9B6537Faaad0AE658",
        "mirrorAddress": "0x224e0CE4F4132eAc88C145b6B294512056BbFE45",
        "mirrorBalance": "55.55",
        "chainId": 999,
        "verify2FASuccessTimes": 3,
        "createTime": 1657088981796,
        "avatar": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAAAAQwAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAAHRyWFlaAAABZAAAABRnWFlaAAABeAAAABRiWFlaAAABjAAAABRyVFJDAAABoAAAAChnVFJDAAABoAAAAChiVFJDAAABoAAAACh3dHB0AAAByAAAABRjcHJ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n2Dd5rbVQAAADgFVPwx+G2xzzPX39khREROpEVmrpYa2lkpqiNskcjS1zXDIIPEFXkXL2Ne0tdkULz5q/Rl00ZeBX2wTGja/bhnjyTCe5358CFiO1nrG8nqaaonccYLaSHBP8oyvRj42SDD2hw9atx0sEX1cLG+AUMwyXAcGutkTn28wnA8tFgbLz5BoTWt7eHT0tQQd+3VzY9xOfcp+g6FLtKAa26QQd7YmF58zhdpG7gqp0Ry5F9ugt3uuCQVzei6FbHCQ6rq6upPMbYaPcM+9T1F0a6TogNm0xSEc5syf3ErakS/DsO0Sfme2SLrEpbVQUTQ2lo4YWjkxgb8FlBrRwAHsVUXbIY2bLQPki5REROpEREQhEREIURprUtv1PaYa6imYXuaOth2u1E7m0jjx581LoiEIiIhCIiIQiIiEIiIhCIiIQiIiEKL1DqG36btU1fXzsZsNJjjLu1K7k1o55PlxKIiEL//2Q=="
        "isPlayPass": false, //created with Instant PlayPass or not
        "createdFromRedeemCode": false, // This is optional key
    }
}
{
  "success": false,
  "message": "error message",
  "data" : {username}
}

Get linked secondary addresses by Primary Address or ZooGamesID

GET API_END_POINT_URL/API_KEY/secondary/[PRIMARY_ADDRESS or ZOO_GAMES_ID]

Path Parameters

Name
Type
Description

PRIMARY_ADDRESS or ZOO_GAMES_ID*

Address / String

ZooGamesId

API_KEY*

String

Api Key

{
    "success": true,
    "data": [
        {
            "_id": "62c595905cc9847c7084fa4f",
            "secondary": "0xBCeAF0453dE61B48CF0159749f192F5fc6a77298",
            "primary": "0x5E3A8B3683292442fACa52e9B6537Faaad0AE576"
        },
        {
            "_id": "631705be9ecaff218df6fb61",
            "secondary": "0x8AC499c8E2f3CBc9C99034b6e2912149212bE770",
            "primary": "0x5E3A8B3683292442fACa52e9B6537Faaad0AE576"
        }
]
}
{
  "success": false,
}

Get user profile image directly

GET API_END_POINT_URL/api/user/profile_pic/[ZOO_GAMES_ID]

If there have some image set. It will return base64 encoded image. No profile image or not found a user by ZOO_GAMES_ID will return an "Empty".

Path Parame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IPS6DMvwgHCrSeME5JwR2NeO4QYLDdVR1HqLxaNOkKH3mfEEGD3dzg .....
// Will show an "Empty" content
{
  "success": false,
}
Let's find out how by digging into this quick ZooGames Protocol explanation video

In-Game Chips Tokens (ERC20)

Unleashing the Power of InGameChips in the Gaming Realm

In-Game Chips are ERC20 tokens, which means they offer minting and txs transparency that traditional web2 game currencies can't match. This new token helps games create virtual currencies without providing liquidity to an exchange market.

Developers can create In-Game Chips with ZooGames easy-to-use interface and control them with complete security using the ZooGames API. With In-Game Chips, players can earn chips by completing missions or buy chips in packs. They can even be airdropped to mirror addresses on ZooGames. In short, In-Game Chips are the future of gaming and a key element of the Web3 gaming experience.

Use Cases

  1. Virtual Currency: In-Game Chips can be used as a virtual currency within the game ecosystem. Players can earn In-Game Chips by completing in-game tasks, missions, or achievements. These chips can then be used to purchase in-game items, upgrades, cosmetics, or unlock new levels.

  2. In-Game Economy: Developers can design complex in-game economies using In-Game Chips. Players can trade or exchange chips with each other to acquire rare items, trade with other players, or participate in player-driven economies within the game.

  3. Reward System: In-Game Chips can serve as a reward system for players who engage actively in the game. Developers can distribute chips to players as rewards for reaching milestones, winning competitions, or demonstrating exceptional skills. These rewards can incentivize players to continue playing and achieving in the game.

  4. Social Interaction: In-Game Chips can facilitate social interaction among players. Players can gift or trade chips with their friends or engage in friendly competitions where chips are wagered. This fosters a sense of community and engagement within the game.

  5. Airdrops and Promotions: In-Game Chips can be airdropped to players' mirror addresses as part of promotional campaigns or as a gesture of appreciation. These airdropped chips can be used to attract new players, retain existing ones, or introduce special events within the game.

  6. Limited Edition Collectibles: Developers can create limited edition or rare InGameChips that serve as collectible items within the game. Players can trade or showcase these unique chips, creating a market for collectors and enthusiasts.

FURTHER POSSIBLE USE CASE Cross-Game Utility: In-Game Chips can have utility across multiple games within the ZooGames ecosystem. Players can accumulate chips from different games and use them interchangeably within any compatible game on the platform, enhancing the interconnectedness of the gaming experience.

Init In-Game Chips creation

To create an In-Game Chips token using the ZooGames API, you can follow these steps:

  1. Send a request to the API endpoint, specifying the Token name and symbol in the request payload.

  2. The API will process your request and generate a new In-Game Chips token with the provided Token name and symbol.

  3. Once the token creation is successful, you will receive a response containing the necessary information about the newly created token, such as its contract address and other relevant details.

  4. You can now use this In-Game Chips token within your game environment.

Initialize ERC20 before using the token

POST API_END_POINT_URL/API_KEY/erc20/create

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

gameAddress*

Address

Address of Game/Project registered Primary Address

name*

String

Name of this ERC20 Token

symbol*

String

Token Symbol

{
  success: true,
  data: {
    tokenAddress: '0xe3c4937ee22e1f2eb80d2d7a881e7777',
    createTxHash: '0x12345648945648784564687845647887',
    type:'erc20'
  }
}

You need to keep Token Address for the future usage

{
    success: false;
    errors: [
        {
            message: "any error message",
            data: {
               // Some data properties //
            }
        }
    ];
}

Mint In-Game Chips

This function allows game developers to generate new tokens on-demand, providing flexibility and control over the in-game economy.

Mint Tokens by amount to any ZooGamesID

POST API_END_POINT_URL/API_KEY/erc20/mint

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

gameAddress*

Address

Address of Game/Project registered Primary Address

tokenAddress*

Address

Address of Token you have created or target Token to be minted

amount*

String / Number

Amount to Mint (Max. 18 Decimals) * Recommended to use String over Number

username*

String

The recipient ZooGamesID

{
  success: true,
  data: {
    mintTxHash: '0x12345678745648789546541324',
    tokenAddress: '0xAb5448754A225F655458Ea52988',
    to: 'ZooGamesID',
    amount: '1000',
  }
}
{
    success: false;
    message: 'The primary error message',
    data: {
        errors: [
            {
                message: "any error message",
                data: {
                   // Some data properties //
                }
            }
        ];
    }
}

Burn In-Game Chips

This function allows game developers to remove existing tokens from circulation, providing control over the in-game economy and token supply.

Burn Tokens by amount from any ZooGamesID

POST API_END_POINT_URL/API_KEY/erc20/burn

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

gameAddress*

Address

Address of Game/Project registered Primary Address

tokenAddress*

Address

Address of Token you have created or target Token to be burnt

amount*

String / Number

Amount to Burn (Max. 18 Decimals) * Recommended to use String over Number

username*

String

The target ZooGamesID

{
  success: true,
  data: {
    burnTxHash: '0x12345678745648789546541324',
    tokenAddress: '0xAb5448754A225F655458Ea52988',
    from: 'ZooGamesID',
    amount: '1000',
  }
}
{
    success: false;
    message: 'The primary error message',
    data: {
        errors: [
            {
                message: "any error message",
                data: {
                   // Some data properties //
                }
            }
        ];
    }
}

Transfer In-Game Chips

Capability to transfer In-Game Chips tokens from one user (User A) to another user (User B) using the "TRANSFER" function. This function allows for seamless peer-to-peer token transfers within the game ecosystem.

Transfer Tokens by amount to any ZooGamesID

POST API_END_POINT_URL/API_KEY/erc20/transfer

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

gameAddress*

Address

Address of Game/Project registered Primary Address

tokenAddress*

Address

Address of Token you have created or target Token to be transferred

amount*

String / Number

Amount to transfer (Max. 18 Decimals) * Recommended to use String over Number

fromUser*

String

The source ZooGamesID

toUser*

String

The target ZooGamesID

{
  success: true,
  data: {
    transferTxHash: '0x12345678745648789546541324',
    tokenAddress: '0xAb5448754A225F655458Ea52988',
    from: 'ZooGamesIDA',
    to: 'ZooGamesIDB'
    amount: '1000',
  }
}
{
    success: false;
    message: 'The primary error message',
    data: {
        errors: [
            {
                message: "any error message",
                data: {
                   // Some data properties //
                }
            }
        ];
    }
}

In-Game Chips Balance

Check the token Balance by ZooGamesID

POST API_END_POINT_URL/API_KEY/erc20/balance

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

gameAddress*

Address

Address of Game/Project registered Primary Address

tokenAddress*

Address

Address of Token you have created or target Token to be checked

username*

String

ZooGamesID to check

{
  success: true,
  data: '1000',
}
{
    success: false;
    message: 'The primary error message',
    data: {
        errors: [
            {
                message: "any error message",
                data: {
                   // Some data properties //
                }
            }
        ];
    }
}

In-game NFTs (ERC721)

Custom NFT Tokens generated in-game

In-Game NFTs are ERC721 tokens that offer transparency in minting and transactions. They enable games to create virtual assets without the pain of deploying a smart contract. Developers can easily create In-Game NFTs using ZooGames API and control them securely.

Use Cases

  1. Virtual Assets: Earn or purchase In-Game NFTs for in-game items, upgrades, or unlocking levels.

  2. In-Game Economy: engage in player-driven economies within the game.

  3. Reward System: Distribute NFTs as rewards for achievements, competitions, or milestones.

  4. Social Interaction: Gift or trade NFTs, foster community engagement.

  5. Airdrops and Promotions: Airdrop NFTs to players, attract new users or introduce special events.

  6. Limited Edition Collectibles: Create rare NFTs for trading and collecting.

You can choose to send In-Game NFTs to either the Mirror wallet or the Primary wallet of users. Sending NFTs to the Primary wallet allows users to trade them on our official NFT store, OPENZOO.IO. Once your NFT collection is registered, you can add them to Openzoo and claim transaction royalties.

Initiating In-Game NFTs Creation

To create an In-Game NFTs token using the ZooGames API, you can follow these steps:

  1. Send a request to the API endpoint, providing the desired Token name and symbol in the request payload.

  2. The API will process your request and generate a new In-Game NFTs token with the specified Token name and symbol.

  3. Upon successful creation, you will receive a response containing relevant information about the newly created token, such as its contract address and other necessary details.

  4. You can now incorporate this In-Game NFTs token into your game environment, allowing players to interact with and own unique virtual assets.

Initialize ERC721 before using the token

POST API_END_POINT_URL/API_KEY/erc721/create

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

gameAddress*

Address

Address of Game/Project registered Primary Address

name*

String

Name of this ERC721 Token

symbol*

String

Token Symbol

{
  success: true,
  data: {
    tokenAddress: '0xe3c4937ee22e1f2eb80d2d7a881e7777',
    createTxHash: '0x12345648945648784564687845647887',
    type:'erc721'
  }
}

You need to keep Token Address for the future usage

{
    success: false;
    message: 'The primary error message',
    data: {
        errors: [
            {
                message: "any error message",
                data: {
                   // Some data properties //
                }
            }
        ];
    }
}

Batch Mint

This function empowers game developers to generate new NFT tokens on-demand, granting them flexibility and control over the in-game economy. You have the ability to mint NFTs in batches using an array.

Mint Tokens by batch

POST API_END_POINT_URL/API_KEY/erc721/batchMint

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

gameAddress*

Address

Address of Game/Project registered Primary Address

tokenAddress*

Address

Address of Token you have created or target Token to be minted

tokenIds*

Array of Number

Array of IDs to be minted ex:

[1,2,3,4,5] and must not be duplicated or ['0x00a'] as a hex number (Starting with 0x)

to*

String

The recipient primary address (tradable) or Mirror address (not tradable)

tokenJsons*

Array of Json Objects

Array of Json objects to be minted

ex:

[ {token_id: 1, name: 'NFT 1', description:'',image:'<url>'}, {token_id: 1, name: 'NFT 2', description:'',image:'<url>'} ]

{
  success: true,
  data: {
    tokenAddress: '0x3dD99feA434E323EAF274148712226eD2d549dA3',
    to: '0x6D2A8B3683293442fACa52e9B6537Faaad0AE576',
    tokenIds: [ 1, 2, 3 ],
    tokenUris: [
      'https://openzoo.mypinata.cloud/ipfs/QmbyNPqUeahZxxkpSiSvYS6Rpu2SRXtJLU5rumUFFaheDx',
      'https://openzoo.mypinata.cloud/ipfs/QmPhY2yrmDCVKMEkzQyA39JQ2zTuacNU3eWFQTrU54jHsx',
      'https://openzoo.mypinata.cloud/ipfs/QmTZkvvRzdocDxqCSjG7jKu35GzYk7ehA4wC7n5MNearWB'
    ],
    mintTxHash: '0x158364cab5489e8a85ce7683bcb58154f8b5ce0bf647ce2b6a2ccd190dd8d9f2'
  }
}
{
    success: false;
    message: 'The primary error message',
    data: {
        errors: [
            {
                message: "any error message",
                data: {
                   // Some data properties //
                }
            }
        ];
    }
}

Please ensure that only unique TokenIDs are used when minting NFTs, or if you are using a running number system, make sure to use the latest TokenIDs to maintain uniqueness.

Batch Burn

This function enables game developers to remove existing NFT tokens from circulation, granting them control over the in-game economy and token supply. You can burn NFTs in batches using an array, effectively eliminating them from the system and ensuring their scarcity and value.

Burn Tokens by amount from ZooGamesID

POST API_END_POINT_URL/API_KEY/erc721/batchBurn

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

gameAddress*

Address

Address of Game/Project registered Primary Address

tokenAddress*

Address

Address of Token you have created or target Token to be burnt

tokenIds*

Array of Number

Array of IDs to be burnt ex:

[1,2,3]

{
  success: true,
  data: {
    tokenAddress: '0x3dD98feA434E323EAF274148712226eD2d549dA3',
    tokenIds: [ 1, 2 ],
    burnTxHash: '0x923b3c52bb17a6293d15e37c554824df0a26213abadedb274ff76cc2643ea502'
  }
}
{
    success: false;
    message: 'The primary error message',
    data: {
        errors: [
            {
                message: "any error message",
                data: {
                   // Some data properties //
                }
            }
        ];
    }
}

Please ensure that each minted NFT has a unique token ID and avoids reusing any duplicate IDs, regardless of whether the ID has been previously burned. This will ensure the uniqueness and integrity of the NFTs within the system.

Total Mint count

The Total Mint Count API retrieves the total number of operations in your collection. By making a request to this API, you can obtain the count of NFTs operations that have been minted for a specific collection, providing valuable information about the size and scale of your collection.

Token Minted Counter operation (Not NFT supply)

POST API_END_POINT_URL/API_KEY/erc721/totalMintCount

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

tokenAddress*

Address

Address of Token you have created or target Token to be checked

{
  success: true,
  data: '3',
}
{
    success: false;
    message: 'The primary error message',
    data: {
        errors: [
            {
                message: "any error message",
                data: {
                   // Some data properties //
                }
            }
        ];
    }
}

Get user In-Game NFTs

The Get In-Game NFTs API allows you to retrieve In-Game NFTs based on either the user's ZooGamesID or their Primary Address. You can use this API to obtain multiple NFT collections associated with a user, providing access to their owned NFTs within the game ecosystem.

Retrieve the list of In-Game items based on the ZooGamesID or Primary Address.

GET API_END_POINT_URL/API_KEY/userInfo/nft/inGameNft/[ZooGamesID or Address]

Example:

https://api-testnet.zoo.games/api/783061c8130f55455bd203fc2e6f5385/userInfo/nft/inGameNft/cryptofennectest?collection_in=0x3dD99feA434E323EAF274148712226eD2d549dA3&first=100&skip=0

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

ZooGamesID or Address*

String

If you use ZooGamesID it will get NFT list by linking user Addresses

If you use Address it will get NFT list by an address

collection_in*

Addresses

Contract address of NFTs

You can use comma (,) to get many collections you want.

first

Number

Limitation of the list. Default is 100

skip

Number

It's an Offset (Start from). Default is 0

{
    "success": true,
    "data": [
        {
            "collection": "0x3dd99fea434e323eaf274148712226ed2d549da3",
            "tokenId": "1",
            "address": "0x5d2a8b3683292442faca52e9b6537faaad0ae576",
            "chainId": "999",
            "timestamp": "1685951205",
            "uri": "https://openzoo.mypinata.cloud/ipfs/QmbyNPqUeahZxxkpSiSvYS6Rpu2SRXtJLU5rumUFFaheDx",
            "token_id": 1,
            "name": "NFT1",
            "description": "NFT Demo",
            "image": "https://picsum.photos/200/300"
        }
            ]
}
{
    success: false;
}

Currently, this API supports retrieving the list of NFTs based on the ZooGamesID and Primary Address or any other addresses associated with the user. However, it does not provide the functionality to fetch the list of linked Secondary addresses by the ZooGamesID.

GitHub - zoo-games/Generic-TG-WebAPP: WebAPP Authentication for Telegram BotGitHub

Game Settlement

All About Game Settlement API

Before utilizing these APIs, it is essential to have a clear understanding of the concept of game settlement and ZooGames user wallets.

Ready

You can utilize this API to verify the eligibility of players who wish to join a game while they are in the lobby or waiting room. The API allows you to perform several checks to ensure that each player meets the necessary requirements. These checks include:

  1. Validating the vZOO balance of each player: Ensuring that each player has a sufficient balance of vZOO tokens to participate in the game.

  2. Checking if a player has been banned from the platform: Verifying if a player has been restricted from accessing the game due to violations or other reasons.

  3. Verifying that the cost of joining the game does not exceed the maximum vZOO spending limit set for the game.

  4. Grant access to the user if they pass all the validations of the game settlement.

  5. Checking if the number of players exceeds the limit set for the game: Ensuring that the number of players attempting to join does not exceed the specified limit.

  6. Verifying if the game owner's mirror address has sufficient vZOO balance: This check is useful if the game owner needs to top-up the reward or provide additional funds.

  7. Verifying if the game has been verified by Zoo.Games: This check ensures that the game has undergone the necessary verification process by Zoo.Games.

We recommend that the game server performs these checks for each player upon entry. By calling this API with the relevant player information, the game server can determine if a player meets the criteria. If a player fails to pass any of the checks, the game server should reject their entry and remove them from the lobby or waiting room. This process helps maintain the integrity and fairness of the game environment.

Verify all information of players before starting the game

POST API_END_POINT_URL/API_KEY/game/ready

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

userJwts*

Array

Array of user's JWT Token list. - Must be arranged by the user entry order

userPrimaryAddresses*

Array

Array of user's primary address.

- Must be arranged by the user entry order - Exact same array length as user JWT

userLockAmounts*

Array

Array of user's spending vZOO.

- Must be arranged by the user entry order - Exact same array length as user JWT - The value must be less than Game Config "maxVZOO"

gameAddress*

Address

Address of Game/Project registered Primary Address

gameLockAmount*

Number

Game owner top-up amount in this game - Entry 0 for no top-up

{
  success: true,
  data: {
    roundId: '0xe3c4937ee22e1f2eb80d2d7a881e7777de9aa547006a145f4dd5bb8ec7b40e31'
  }
}

This roundId doesn't be used on this time.

// Error by API //
{
    success: false;
    message: 'The primary error message',
    data: {
        errors: [
            {
                message: "sub error message #1",
                data: {
                   // requested data//
                }
            },
            {
                message: "sub error message #2",
                data: {
                   // requested data//
                }
            }
        ];
    }
}
// Error by Contract / Reverted by contract //
{
  success: false,
  message: 'Contract Pre-Check Error',
  data: {
    op: '0x95A6010F499005DE33F0DD526ce8f5a36CeA45a3',
    scError: {
        // Reverted reason //
    }
  }
}

List of error messages

Errors
Description

checkApiKey invalid api key (user not in allow list)

Your registered game isn't verified

game_address not match

API Key and game_address doesn't match

jwt malformed

JWT Tokens incorrect

Game round already started

Generated Round ID already started. Please try to call this function again

Game not enabled

Your registered game isn't verrified

Too many players

Number of Players exceeded maxPlayerPerRound in Globl Game config

No players

No players list sent

Player count mismatch

The list doesn't match of length

Game has not enough VZOO

In case you want to top-up a reward.

This mean game mirror address doesn't have enough vZOO as a fund

vZOO Balance not enough

Some Players don't have enough vZOO to spend

gameVerify gameAddress not match in user Jwt

gameAddress in JWT payload doesn't match with same as caller gameAddress

gameVerify user Jwt expired

Player's JWT already expired. Need to approve again

gameVerify user allowance not enough

Player didn't approve to spend enough vZOO by requirement

gameVerify user balance not enough

Player don't have enough balance to spend

Player amount too large

vZOO require per use is higher than MAX vZOO LIMIT Global Game Config

Player has no ticket

If game required to purchase a ticket. It means Player dont have a ticket

User was banned

This user was banned from the system

Example of Game Settlement - Ready

Here's a simple example of using the "Ready" API with 2 players in the lobby/waiting room:

Assuming the game developer wants to add an extra reward of 10 vZOO and the entry fee for each user is 10 vZOO, we can calculate that the total reward pool is 30 vZOO.

Please ensure that the list of players is ordered according to their entry into the lobby/waiting room.

import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'
import axios from 'axios';

// Initialized API KEY and SECRET KEY
const API_KEY = 'YourApiKey';
const SEC_KEY = 'YourSecretKey';
const GAME_ADDRESS = '0x8Cf0A877E906DEaD748A41aE9EA8c220E4247D35';
// Signing body data with HMAC signing
let body = {
    userJwts: ['Player#1 JWT', 'Player#2 JWT'], // JWTs by ordered of entry
    userPrimaryAddresses: ['0x682A8B3683292442fACa52e9B6537Fabcd0AE568','0x79CA8B3683292442fACa52e9B6537FE58d0AE576'],
    userLockAmounts: [10,10],
    GAME_ADDRESS,
    gameLockAmount: 10,
  };
let bodyMessage = JSON.stringify(body); 
let hmac = ApiKey.signData(bodyMessage, SEC_KEY); // hmac or SignedSignatureFromPayload  

// Request by Post Method //
let ret = await axios.post(`/api/${API_KEY}/game/ready`, body, {headers:{Authorization: `Bearer ${hmac}`}});
console.log('game ready:', ret.data);

Start

After using the "Ready" API to verify the validity of the game settlement, you can proceed to use the "Start" function to initiate the game round. The Start API allows you to lock the specified amounts from the users and the game developer based on your provided parameters.

  • When calling the "Start" API, it will internally trigger the "Ready" API again for a final check. This ensures that the game settlement is verified before proceeding. Additionally, it is important to maintain the order of user entries, preserving the index of the array to accurately track and process each player's participation.

  • After executing the "Start" function, remember to record the "roundId" provided by the API. This identifier will be required for subsequent API calls such as the "Game Over" API or "Game Cancel" API, enabling proper tracking and management of the game round.

  • It is crucial to keep track of the total vZOO spent by the users and the game address during the game round. This information will be necessary for broadcasting the final reward. By accurately recording and storing these values, you can ensure the proper distribution of rewards to the participants.

  • Overall, by following these guidelines and maintaining the necessary data and order, you can effectively utilize the "Start" API to initiate the game round and proceed with subsequent actions, including reward distribution and game conclusion.

Start the game round

POST API_END_POINT_URL/API_KEY/game/start

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

userJwts*

Array

Array of user's JWT Token list. - Must be arranged by the user entry order

userPrimaryAddresses*

Array

Array of user's primary address.

- Must be arranged by the user entry order - Exact same array length as user JWT

userLockAmounts*

Array

Array of user's spending vZOO.

- Must be arranged by the user entry order - Exact same array length as user JWT - The value must be less than Game Config "maxVZOO"

gameAddress*

Address

Address of Game/Project registered Primary Address

gameLockAmount*

Number

Game owner top-up amount in this game - Entry 0 for no top-up

{
  success: true,
  data: {
    roundId: '0xe3c4937ee22e1f2eb80d2d7a881e7777de9aa547006a145f4dd5bb8ec7b40e31',
    txHash: '0xe259f525616f295e877a0da35b59e45f6c2e48c340a16102eb995f0d0c4c36a1'
  }
}

This roundId need to be saved locally to use on futher APIs

// Error by API //
{
    success: false;
    message: 'The primary error message',
    data: {
        errors: [
            {
                message: "sub error message #1",
                data: {
                   // requested data//
                }
            },
            {
                message: "sub error message #2",
                data: {
                   // requested data//
                }
            }
        ];
    }
}
// Error by Contract / Reverted by contract //
{
  success: false,
  message: 'Contract Pre-Check Error',
  data: {
    op: '0x95A6010F499005DE33F0DD526ce8f5a36CeA45a3',
    scError: {
        // Reverted reason //
    }
  }
}

List of error messages

Errors
Description

checkApiKey invalid api key (user not in allow list)

Your registered game isn't verified

game_address not match

API Key and game_address doesn't match

jwt malformed

JWT Tokens incorrect

Game round already started

Generated Round ID already started. Please try to call this function again

Game not enabled

Your registered game isn't verrified

Too many players

Number of Players exceeded maxPlayerPerRound in Global Game config

No players

No players list sent

Player count mismatch

The list doesn't match of length

Game has not enough VZOO

In case you want to top-up a reward.

This mean game mirror address doesn't have enough vZOO as a fund

vZOO Balance not enough

Some Players don't have enough vZOO to spend

gameVerify gameAddress not match in user Jwt

gameAddress in JWT payload is not matched to caller gameAddress

gameVerify user Jwt expired

Player's JWT has expired. Need to re-approve it

gameVerify user allowance not enough

Player didn't approve to spend enough vZOO by requirement

gameVerify user balance not enough

Player don't have enough balance to spend

Player amount too large

vZOO require per use is higher than MAX vZOO LIMIT Global Game Config

Player has no ticket

If game required to purchase a ticket. It means Player dont have a ticket

User was banned

This user was banned from the system

Example of Game Settlement - Start

Here's a simple example of using the "Start" API with 2 players in the lobby/waiting room:

Assuming the game developer wants to add an extra reward of 10 vZOO and the entry fee for each user is 10 vZOO, we can calculate that the total reward pool is 30 vZOO.

*Please make sure that the list of players is ordered based on their entry into the lobby/waiting room.

**Note: Please ensure that you have already verified the data from the "Game Ready" API before calling this function.

import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'
import axios from 'axios';

// Initialized API KEY and SECRET KEY
const API_KEY = 'YourApiKey';
const SEC_KEY = 'YourSecretKey';
const GAME_ADDRESS = '0x8Cf0A877E906DEaD748A41aE9EA8c220E4247D35';
// Signing body data with HMAC signing
let body = {
    userJwts: ['Player#1 JWT', 'Player#2 JWT'], // JWTs by ordered of entry
    userPrimaryAddresses: ['0x682A8B3683292442fACa52e9B6537Fabcd0AE568','0x79CA8B3683292442fACa52e9B6537FE58d0AE576'],
    userLockAmounts: [10,10],
    GAME_ADDRESS,
    gameLockAmount: 10,
  };
let bodyMessage = JSON.stringify(body); 
let hmac = ApiKey.signData(bodyMessage, SEC_KEY); // hmac or SignedSignatureFromPayload  

// Request by Post Method //
let ret = await axios.post(`/api/${API_KEY}/game/start`, body, {headers:{Authorization: `Bearer ${hmac}`}});
console.log('game ready:', ret.data);

Over

The Over API is used to finalize the game round and broadcast the rewards that each user will receive from the locked vZOO pool of a specific game. The rules for distributing rewards are as follows:

  1. The total amount paid by players should not exceed the total locked vZOO in the pool.

  2. Assume you have two players with an entry fee of 100 vZOO each, resulting in a locked vZOO pool of 200 vZOO. If the final reward is 190 vZOO for Player A and 10 vZOO for Player B (determined by the game), you need to call the "Game Over" API with adjusted rewards.

  3. If the game developer is entitled to receive a fee from the players' rewards, it should be deducted accordingly. This deduction occurs after the platform fee calculation.

  4. It's essential to ensure that the total amount paid by players, including the platform fee, does not exceed the locked vZOO pool amount.

  5. If the game developer has topped up additional rewards for this round, it is necessary to follow the rule of "Total paid + Platform Fee <= Locked vZOO Pool amount."

By adhering to these rules and providing the adjusted rewards (after deducting the platform fee and game developer's fee, if applicable), the "Game Over" API can be used to distribute the final rewards to the players.

Finalize the game round with broadcast a reward

POST API_END_POINT_URL/API_KEY/game/over

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

gameResultAmount*

Number

How much reward Game Address wants to takes a reward from the game round. such as Fee or any purposes

usersResultAmount*

Array

Array of user's reward deduct with Platform fee.

- Must ordered by entried order of user exactly from Game Start API

roundId*

Hex ID

ID your got from "Game Start" API result.

Start with '0x1234....89'

gameAddress*

Address

Address of Game/Project registered Primary Address

{
  success: true,
  data: {
    roundId: '0xe3c4937ee22e1f2eb80d2d7a881e7777de9aa547006a145f4dd5bb8ec7b40e31',
    txHash: '0xe259f525616f295e877a0da35b59e45f6c2e48c340a16102eb995f0d0c4c36a1'
  }
}

This roundId need to be saved locally to use on futher APIs

// Error by API //
{
    success: false;
    message: 'The primary error message',
    data: {
        errors: [
            {
                message: "sub error message #1",
                data: {
                   // requested data//
                }
            },
            {
                message: "sub error message #2",
                data: {
                   // requested data//
                }
            }
        ];
    }
}
// Error by Contract / Reverted by contract //
{
  success: false,
  message: 'Contract Pre-Check Error',
  data: {
    op: '0x95A6010F499005DE33F0DD526ce8f5a36CeA45a3',
    scError: {
        // Reverted reason //
    }
  }
}

List of error messages

Errors
Description

Game round not started

Game is not started yet or already overed

Game round not found

Cannot found this game round by roundId

Game round too short

You executed this API too early than Minimum Game round time in Global Game Config

Player count mismatch

Length of users reward not exactly the same with Length of users after you called "Game Start"

Game result amount is too large

Total Paid + Platform fee was more than Total vZOO locked in the pool

You need to check gameResultAmount and usersResultAmount parameter

Example of Game Settlement - Over

This is simple example to use "Over" API with the result

  • Total Locked is 30 vZOO by 2 usesrs (10 vZOO each) and Game Dev top-up 10 vZOO

  • Game Dev don't need any Fee - gameResultAmount = 0

  • Users got [18 , 2] but need to substract with 2% Platform Fee then it will be usersResultAmount = [17.64, 1.8]

* Don't forget that this reward list must be ordered by the order of entry to the Lobby / Waiting Room

** If Game Dev want some fee just change gameResultAmount to another number and deduct userResultAmount by each player. But the totalpaid + fee must less than total locked vZOO pool

import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'
import axios from 'axios';

// Initialized API KEY and SECRET KEY
const API_KEY = 'YourApiKey';
const SEC_KEY = 'YourSecretKey';
const GAME_ADDRESS = '0x8Cf0A877E906DEaD748A41aE9EA8c220E4247D35';
// Round Id you got from returned value of "Game Start"
const roundId = '0x5a9d48e489bd22ffa627937aec97d2f8e15f0758b3cab9f208f1642450cbb4e6'
// Signing body data with HMAC signing
let body = {
    gameResultAmount: 0,
    usersResultAmount: [17.64, 1.8],
    roundId,
    GAME_ADDRESS ,
  };
let bodyMessage = JSON.stringify(body); 
let hmac = ApiKey.signData(bodyMessage, SEC_KEY); // hmac or SignedSignatureFromPayload  

// Request by Post Method //
let ret = await axios.post(`/api/${API_KEY}/game/over`, body, {headers:{Authorization: `Bearer ${hmac}`}});
console.log('game ready:', ret.data);

Over V2

This is similar to V1, but there’s no need to deduct a fee. You can input the full amount of rewards. The only condition is that the total reward amount must match exactly.

For example, if you startAPI request with 4 players and each player has locked 100 vZOO, then the total locked vZOO is 400 vZOO.

With this Over V2 API, you need to distribute all 400 vZOO to the players. The reward amount cannot be less or more than this. It must be exactly 400 vZOO.

Finalize the game round with broadcast a reward

POST API_END_POINT_URL/API_KEY/game/over_v2

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

gameResultAmount*

Number

How much reward Game Address wants to takes a reward from the game round. such as Fee or any purposes

usersResultAmount*

Array

Array of user's reward

- Must ordered by entried order of user exactly from Game Start API

roundId*

Hex ID

ID your got from "Game Start" API result.

Start with '0x1234....89'

gameAddress*

Address

Address of Game/Project registered Primary Address

{
  success: true,
  data: {
    roundId: '0xe3c4937ee22e1f2eb80d2d7a881e7777de9aa547006a145f4dd5bb8ec7b40e31',
    txHash: '0xe259f525616f295e877a0da35b59e45f6c2e48c340a16102eb995f0d0c4c36a1'
  }
}

This roundId need to be saved locally to use on futher APIs

// Error by API //
{
    success: false;
    message: 'The primary error message',
    data: {
        errors: [
            {
                message: "sub error message #1",
                data: {
                   // requested data//
                }
            },
            {
                message: "sub error message #2",
                data: {
                   // requested data//
                }
            }
        ];
    }
}
// Error by Contract / Reverted by contract //
{
  success: false,
  message: 'Contract Pre-Check Error',
  data: {
    op: '0x95A6010F499005DE33F0DD526ce8f5a36CeA45a3',
    scError: {
        // Reverted reason //
    }
  }
}

List of error messages

Errors
Description

Game round not started

Game is not started yet or already overed

Game round not found

Cannot found this game round by roundId

Game round too short

You executed this API too early than Minimum Game round time in Global Game Config

Player count mismatch

Length of users reward not exactly the same with Length of users after you called "Game Start"

Game result amount is too large

Total Paid + Platform fee was more than Total vZOO locked in the pool

You need to check gameResultAmount and usersResultAmount parameter

Cancel

The Cancel API is used when there is an issue with a specific game round, and you need to cancel it. By calling this API, all the vZOO tokens that were locked, both from the users and the game address, will be returned in their full amount.

Cancel the game round and return all locked vZOO

POST API_END_POINT_URL/API_KEY/game/cancel

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Query Parameters

Name
Type
Description

API_KEY*

String

API_KEY

Request Body

Name
Type
Description

roundId*

Hex ID

ID you get from the "Game Start" API result.

Start with '0x1234....89'

gameAddress*

Address

Address of Game/Project registered Primary Address

{
  success: true,
  data: {
    roundId: '0xe3c4937ee22e1f2eb80d2d7a881e7777de9aa547006a145f4dd5bb8ec7b40e31',
    txHash: '0xe259f525616f295e877a0da35b59e45f6c2e48c340a16102eb995f0d0c4c36a1'
  }
}
// Error by API //
{
    success: false;
    message: 'The primary error message',
    data: {
        errors: [
            {
                message: "sub error message #1",
                data: {
                   // requested data//
                }
            },
            {
                message: "sub error message #2",
                data: {
                   // requested data//
                }
            }
        ];
    }
}
// Error by Contract / Reverted by contract //
{
  success: false,
  message: 'Contract Pre-Check Error',
  data: {
    op: '0x95A6010F499005DE33F0DD526ce8f5a36CeA45a3',
    scError: {
        // Reverted reason //
    }
  }
}

List of error messages

Errors
Description

Game round not started

Game is not started yet or already overed

Game round not found

Cannot found this game round by roundId

Game round too short

You executed this API too early than Minimum Game round time in Global Game Config

Player count mismatch

Length of users reward not exactly the same with Length of users after you called "Game Start"

Game result amount is too large

Total Paid + Platform fee was more than Total vZOO locked in the pool

You need to check gameResultAmount and usersResultAmount parameter

Logo

Quick Start

QuickStart Guide for Seamless Integration

Creation of your Game Address

Every game uses a Game Address, which acts as a routing mechanism for in-game transactions. This address will be your game's wallet that receives the funds collected (your profit) from sales or a percentage of transactions or any other mechanics you have chosen.

It's important to note that funds can be withdrawn with a 7-day delay. This delay allows us to verify that a legitimate pattern has been used in the game and that no fraudulent activity has been generated.

To proceed, please visit Zoo.Games and create a ZooGamesID that will control this address.

How to create a ZooGamesID with METAMASK (recommended)

In order to communicate with the protocol, you need to obtain a free API key from our team. To do this, please reach out to a ZooGames team member or fill out this form.

Once your game fully utilizes the Testnet functions of the protocol, we will provide you with a Mainnet API Key for the final release of your game.

The use of the protocol is free; however, transaction fees are automatically deducted to generate additional rewards for players (GameStake).

SDK installation

To interact with our API, we recommend installing our official SDK, which provides the best integration with our system. This SDK simplifies the process of connecting to our API and provides pre-built functions and tools to facilitate development.

Please follow the installation instructions provided in the documentation specific to your chosen SDK. This will ensure that you have the necessary libraries and dependencies set up correctly in your development environment.

By using our official SDK, you can streamline the integration process and take advantage of the features and functionalities we offer in a more efficient and effective manner.

# Install via NPM
npm install --save zoo-game-sdk

Testnet Faucet

We have developed a straightforward testnet faucet that allows you to request testnet vZOO tokens.

Let's start with "Authentication"

Faucet

Testnet vZOO faucet for your ZooGamesID

By using the faucet, you can acquire the necessary testnet vZOO tokens to simulate transactions and test various functionalities within the testnet environment. Please note that the amount of testnet vZOO tokens you can request is limited to 1000.

Faucet
By ZooGamesID

Game Settlement Concept

Understanding Game Settlement: Optimizing In-Game Transactions

1. Basic concept

Before implementing the GameSettle API, let's start with a basic concept of game settlement. Imagine you want to develop a simple card game where four players participate.

Each player needs to spend 100 vZOO to join the game, resulting in a total of 400 vZOO in the game pool. At the end of the game, the winner receives 200 vZOO, the second-place player receives 150 vZOO, the third-place player receives 50 vZOO, and the fourth-place player receives nothing. You can use the game settlement API to broadcast the vZOO rewards each player has obtained.

In the game lobby, Player #1 joins. The game server calls the "Game/Ready" API to check Player #1's vZOO balance. If the balance is sufficient, the player is verified and remains in the lobby. If not, the player is kicked out.

  • Player #2 joins but doesn't have enough vZOO to play. The game server removes this player from the lobby.

  • Players #3, #4, and #5 join with sufficient vZOO to play.

  • With four players ready, the game server calls the "Game/Start" API to initiate the game. This API transfers their 100 vZOO to the locked vZOO pool, totaling 400 vZOO.

  • After gameplay, the final vZOO amounts for each player are as follows:

    Player #3 (Winner): 200 vZOO

    Player #4 (Second place): 150 vZOO

    Player #1 (Third place): 50 vZOO

    Player #5: 0 vZOO

  • The game server needs to call the "Game/Over" API with the round ID and provide the player reward information in the order they entered (from "Game/Start"), such as [50, 200, 150, 0].

2. Adding Developer Fees

If you want to receive a fee from each game, for example, 5%, you can deduct this percentage from what each player receives.

After the gameplay, the final vZOO amounts for each player are as follows:

  • Player #3 (Winner): 200 vZOO

  • Player #4 (Second place): 150 vZOO

  • Player #1 (Third place): 50 vZOO

  • Player #5: 0 vZOO

To calculate the developer fee, deduct 5% from each player's amount:

  • Player #1: 49 vZOO (2.45 vZOO as dev fee)

  • Player #3: 196 vZOO (9.8 vZOO as dev fee)

  • Player #4: 147 vZOO (7.35 vZOO as dev fee)

  • Player #5: 0 vZOO (0 vZOO as dev fee)

The total developer fee is 19.6 vZOO, and the final broadcast amounts become [46.55, 186.2, 139.65, 0]. The game server simply calls the "Game/Over" API with the new final broadcast [46.55, 186.2, 139.65, 0] and provides the gameResultAmount as 19.6.

3. Top-Up extra reward

If you want to offer additional vZOO as promotional rewards to encourage users to play your game, you can top-up the locked vZOO pool. Assuming you want to support an extra 100 vZOO for each game, with four players ready to start the game, the game server can call the "Game/Start" API with a gameLockAmount of 100 vZOO. The total locked vZOO in the pool will then be 500 vZOO. After gameplay, the final vZOO amounts for each player are as follows:

  • Player #3 (Winner): 200 vZOO + 50 vZOO (extra)

  • Player #4 (Second place): 150 vZOO + 40 vZOO (extra)

  • Player #1 (Third place): 50 vZOO + 10 vZOO (extra)

  • Player #5: 0 vZOO

The game server needs to call the "Game/Over" API with the round ID and provide the player reward information in the order they entered (from "Game/Start"), such as [60, 250, 190, 0]. Each reward amount should be reduced by the platform fee (assumed to be 2%). Therefore, the final broadcast amounts will be [58.8, 245, 186.2, 0].

You can also adjust the developer fee in this section. However, ensure that the total paid amount plus the platform fee is less than the total locked vZOO in the pool. From the game server side, you have the flexibility to mix and match these concepts as desired.

3D ZooGenes pack

3D animals with accessories, all in FBX file format

This pack is perfect for game developers looking to add unique, cartoon-style animal characters to their projects. It also includes a variety of accessories, such as hats and glasses, that can be used to customize the animals and make them even more unique.

This is a great opportunity for developers to save time and resources by using these pre-made assets, instead of having to create them from scratch. Get your hands on this pack today and take your game development to the next level!

Link to the asset pack

Don’t forget to credit the ZooEcosystem team when using it!

Oracle Service

A stable oracle price service

Current vZOO / ZOO Price

In the context of this gaming API, an Oracle price of the vZOO token serves an important purpose. The vZOO token is the native token used within the game ecosystem, and its value can fluctuate in the market.

The Oracle price refers to a periodically updated price of the vZOO token, which is obtained from an external data source such as Coingecko or CMC. This price information is then utilized within the gaming API for various purposes, such as:

  1. Game Settlement: When settling game transactions involving the vZOO token, the Oracle price is used to calculate the value of rewards, prizes, or in-game assets in terms of the vZOO token. This ensures fair and accurate distribution of rewards based on the current market value of the token.

  2. Pricing Mechanics: The Oracle price can be utilized to determine the pricing of in-game items, upgrades, or services that are purchased using the vZOO token. By considering the current market price, the game can maintain a balanced economy and adjust the pricing accordingly.

  3. Exchange Rates: If there are interactions or transactions between different tokens or currencies within the game ecosystem, the Oracle price of the vZOO token can be used to establish exchange rates or conversion ratios. This enables seamless conversions and consistent valuation across different token types.

By integrating an Oracle price of the vZOO token into the gaming API, developers can ensure that the in-game economy accurately reflects the real-world value of the token. It enhances the transparency, fairness, and consistency of game mechanics related to the vZOO token, providing a more engaging and reliable gaming experience for the players.

Get the current price of ZOO / vZOO

GET API_END_POINT_URL/api/price/ZOO

We recommend using the Mainnet API to fetch the current price.

{
"success": true,
"symbol": "ZOO",
"price": 0.004199399631770368
}

Platform Fee

June 2023 Fee rules

The platform fee of 2% is automatically collected on every vZOO transactions within the ZooGames ecosystem.

These collected fees are then directed towards the GAMESTAKE feature, which is designed to reward dedicated and enthusiastic players within the ecosystem.

Learn more about GAMESTAKE

GitHub - ZooFarming/ZooGenes-3D-Assets: All 3D Assets of ZooGenesGitHub
Zoo.games vZOO Testnet Faucet
Logo
Reshape The Way You Earn With GAMESTAKEMedium
Logo

Official NFTs

Three official collections available

You can integrate these NFTs into your games seamlessly using our API, allowing you to leverage the unique features and attributes of ZooGenes, ZooBoosters, and ZooElixirs. Enhance your gaming experience by incorporating these freely available NFTs into your game mechanics.

Get user's ZooBoosters

ZooBoosters are primarily known for improving your ZOO rewards when added to a farming pool, but also for being tradable in The Market or on the NFT Marketplace OpenZoo, as well as being used in the ZooGames protocol. The percentage (%) boost and locktime reducer linked to each of these ZooBoosters represent their farming abilities. Some may be the same as others, and some will vary.

As you can see from the above, the boosting number and locktime reducing amount are different. Even on the off chance that these should be the same, each NFT has its own individual number, making it truly unique.

Get all Official ZooBooster NFT by ZooGamesId

GET API_END_POINT_URL/API_KEY/userInfo/nft/zooboosters/ZOO_GAMES_ID

Path Parameters

Name
Type
Description

ZOO_GAMES_ID*

String

ZooGamesId

API_KEY*

String

Api Key

{
  "success": true,
  "data": [
    {
      "tokenId": "710",
      "category": "Foods",
      "item": "R",
      "level": "4",
      "random": "76",
      "boost": "49.076%",
      "reduce": "10.676%",
      "chainId": "999",
      "address": "0x8d2a8b3683292442faca52e9b6537faaad0ae432",
      "name": "Ancient Barrel Cheddar",
      "description": "Ancient Barrel Cheddar",
      "background_color": "f3f2f3",
      "image": "https://zoo-factory.vercel.app/zoo_keeper_icons_v1/Ancient_Barrel_Cheddar.png",
      "attributes": [
        {
          "trait_type": "category",
          "value": "2"
        },
        {
          "trait_type": "level",
          "value": "4"
        },
        {
          "trait_type": "item",
          "value": "2"
        }
      ]
    },
    // More and more NFTs data //
  ]
}
{
  "success": false,
  "message": "error message",
  "data" : {username}
}
Return Data Properties Explanation
  • tokenID: TokenId of the NFT

  • category: Category of Booster Fruits, Foods, Sweets, Potions, Spices, Magic

  • item (aka. Class): N: Normal R: Rare SR: Super Rare SSR: Super Super Rare UR: Ultra Rare

  • level: 1: 1 star 2: 2 stars 3: 3 stars 4: MAX

  • random: It is a constant value that determines the boosting rate or reduction rate within the range of 1 to 300.

  • chainId: NFT from which chain 888: Wanchain Mainnet 999: Wanchain Testnet 43114: Avalanche (mainnet) 43113: Avalanche (Testnet)

  • boost: Boosting rate by percentage ex: “23.243%”

  • reduce: Reduce locked time by percentage ex: “5.643%”

  • address: NFT owner's address linked to ZooGamesID

  • name: Name of NFT

  • description: Description of NFT

  • image: Source of NFT Image (you can use https://app.zookeeper.finance/ insteads of zoo-factory.vercel.app in case of being blocked by some ISP)

  • attributes: source of NFT attributes in IPFS (you can use properties item, category, level instead)

Get user's ZooGenes

ZooGenes set themselves apart from traditional generative NFT projects. Designed specifically for gaming, ZooGenes are dynamic and engaging. Ever wondered what a polar bear sporting sunglasses and a viking hat would look like? Or a charming bunny donning a biker jacket surrounded by flames? These characters possess distinctive visual traits and can be traded among players. However, their uniqueness goes beyond appearances. Each ZooGene comes with individual abilities, such as Strength, Agility, and more. These attributes will carry over to future ZooKeeper games, ensuring that your ZooGenes' capabilities remain relevant and impactful across various gaming experiences.

Get all Official ZooGenes NFT by ZooGameId

GET API_END_POINT_URL/API_KEY/userInfo/nft/zoogenes/ZOO_GAMES_ID

Path Parameters

Name
Type
Description

ZOO_GAMES_ID*

String

ZooGamesId

API_KEY*

String

Api Key

{
  "success": true,
  "data": [
    {
      "tokenId": "16",
      "address": "0x6A2a8b3683292442faca52e9b6537faaad0ae325",
      "chainId": "999",
      "name": "Kagur The Wary Rabbit #16",
      "image": "https://openzoo.mypinata.cloud/ipfs/QmVyPquNVvGV4F6QXZv15nmdRHscM9CCvaT7inB8oF2Ceu",
      "description": "ZooGenes are ZooKeeper’s gaming-oriented generative NFTs. A polar bear wearing sunglasses and a viking hat? A cute little bunny with a biker jacket surrounded by flames? ZooGenes create playable characters used as drivers in-game that will have unique visual characteristics and be tradeable, but also have individual abilities (e.g. Strength, Agility, etc). These stats will be applied to every future ZooKeeper game. It was minted on [zoogenes.io](https://zoogenes.io/).",
      "attributes": [
        {
          "trait_type": "Strength",
          "display_type": "boost_number",
          "value": 84
        },
        {
          "trait_type": "Constitution",
          "display_type": "boost_number",
          "value": 87
        },
        {
          "trait_type": "Dexterity",
          "display_type": "boost_number",
          "value": 21
        },
        {
          "trait_type": "Defense",
          "display_type": "boost_number",
          "value": 12
        },
        {
          "trait_type": "Attack",
          "display_type": "boost_number",
          "value": 67
        },
        {
          "trait_type": "Intelligence",
          "display_type": "boost_number",
          "value": 28
        },
        {
          "trait_type": "Wisdom",
          "display_type": "boost_number",
          "value": 56
        },
        {
          "trait_type": "Charisma",
          "display_type": "boost_number",
          "value": 66
        },
        {
          "trait_type": "Willpower",
          "display_type": "boost_number",
          "value": 27
        },
        {
          "trait_type": "Perception",
          "display_type": "boost_number",
          "value": 63
        },
        {
          "trait_type": "Luck",
          "display_type": "boost_number",
          "value": 86
        },
        {
          "trait_type": "Psyche",
          "display_type": "boost_number",
          "value": 5
        },
        {
          "trait_type": "Recovery",
          "display_type": "boost_number",
          "value": 46
        },
        {
          "trait_type": "Magical",
          "display_type": "boost_number",
          "value": 31
        },
        {
          "trait_type": "Social",
          "display_type": "boost_number",
          "value": 59
        },
        {
          "display_type": "number",
          "trait_type": "Generation",
          "value": 1
        },
        {
          "trait_type": "Background",
          "value": "Rose Quartz"
        },
        {
          "trait_type": "Background Points",
          "value": 100
        },
        {
          "trait_type": "Body",
          "value": "Rabbit"
        },
        {
          "trait_type": "Body Points",
          "value": 125
        },
        {
          "trait_type": "Expression",
          "value": "Wary"
        },
        {
          "trait_type": "Expression Points",
          "value": 100
        },
        {
          "trait_type": "Ghost mode",
          "value": "No"
        },
        {
          "trait_type": "Ghost Points",
          "value": 0
        },
        {
          "trait_type": "Talent Positive #1",
          "value": "Innovative"
        },
        {
          "trait_type": "Talent Positive #2",
          "value": "Capable"
        },
        {
          "trait_type": "Talent Positive #3",
          "value": "Educated"
        },
        {
          "trait_type": "Talent Positive #4",
          "value": "Directed"
        },
        {
          "trait_type": "Talent Positive #5",
          "value": "Smart"
        },
        {
          "trait_type": "Talent Negative",
          "value": "Hypocrite"
        }
      ]
    },
    // More & more NFTs //
  ]
}
{
  "success": false,
  "message": "error message",
  "data" : {username}
}
Return Data Properties Explanation
  • tokenID: TokenId of NFT

  • address: NFT owner's address linked to ZooGamesID

  • name: Name of NFT

  • description: Description of NFT

  • image: Source of NFT Image (you can use https://app.zookeeper.finance/ insteads of zoo-factory.vercel.app in case of being blocked by some ISP)

  • attributes: source of NFT attributes in IPFS. You can use as needed

    1. Stats - trait_type Strength, Constitution, Dexterity, Defense, Attack, Intelligence, Wisdom, Charisma, Willpower, Perception, Luck, Psyche, Recovery, Magical, Social Max Point is 100

    2. Parts of Genes - trait_type Background, Body, Facial, Headgear, Costume, Ghost Mode, Effect

    3. Talents - 5 Positive talents and 1 Negative talent

    4. Class - N: Normal R: Rare SR: Super Rare SSR: Super Super Rare UR: Ultra Rare

    5. Generation - In this version is 1 (No Plan to have more generation)

Get user's ZooElixirs

ZooElixirs are generative NFTs. This means that they are randomly assigned a name, color, and shape, resulting in each ZooElixir being unique.

Get all Official ZooElixirs NFT by ZooGamesId

GET API_END_POINT_URL/API_KEY/userInfo/nft/zooelixirs/ZOO_GAMES_ID

Path Parameters

Name
Type
Description

ZOO_GAMES_ID*

String

ZooGamesId

API_KEY*

String

Api Key

{
  "success": true,
  "data": [
    {
      "tokenId": "19",
      "color": "#820b8e",
      "drops": "1.36%",
      "level": "N",
      "name": "Cruet of Arachnid Venom",
      "shape": "18",
      "chainId": "999",
      "address": "0x5af0a877e906dead748a41ae7da8c220e4246d9e",
      "description": "ZooKeeper Elixir is a powerful item in ZooKeeper Craft, it is used to craft and level up boost NFT card.",
      "external_url": "https://zookeeper.finance",
      "image": "https://graph.wanswap.finance/ipfs/QmT7UZGbF1eB2TCwWSMaLGWawgaXyBvbVABjrccHnZBbbu/19.png",
      "attributes": [
        {
          "trait_type": "shape",
          "value": 19
        },
        {
          "trait_type": "ability",
          "value": "craft"
        }
      ]
    },
    // More & more NFTs
  ]
}
{
  "success": false,
  "message": "error message",
  "data" : {username}
}
Return Data Properties Explanation
  • tokenID: TokenId of NFT

  • color: Hex code of drop color filled ex: “ff123a”

  • level: Class of Elixir. Represent N: Normal , R: Rare, SR: Super Rare, SSR: Super Super Rare and UR: Ultra Rare

  • drops: Percentage of drops filled in Elixir ex: “55.55%”

  • shape: Shape preset ID

  • address: NFT owner's address linked to ZooGamesID

  • name: Name of NFT

  • description: Description of NFT

  • image: Source of NFT Image (you can use https://app.zookeeper.finance/ insteads of zoo-factory.vercel.app in case of been blocked by some ISP)

  • attributes: ---

ZooBooster NFTs Deep DiveMedium
ZooGenes - Gaming Generative NFTs
ZooGenes is not a classic generative NFT project.
Logo
An Introduction to NFT CraftingMedium
Logo
Logo

Wallet Concept

Nomenclature

A ZooGamesID is a unique identifier that represents a player's identity on Zoo.Games. When a player starts a ZooGames compatible game, they enter their ZooGamesID to link their profile to the game.

Each ZooGamesID utilizes 2FA (Two-Factor Authentication) for approving transactions within the game. The 2FA authentication process ensures an additional layer of security and requires the player to provide a second form of verification, typically through a mobile app or email, before authorizing any in-game transactions. This helps prevent unauthorized access and ensures that players have control over the transactions associated with their ZooGamesID.

A Mirror address, also known as a Gaming Wallet to players, is an address created by the protocol on Zoo.Games. It serves as a connection point between the API, games, and the platform. All in-game transactions are associated with the mirror address.

A Primary Address is the main address chosen by the player to link to their ZooGamesID. This primary address is used for all interactions with the ZooGames protocol.

A Secondary Address is an optional feature that allows players to connect additional addresses to their profile. It enables them to link assets from other wallets to their ZooGamesID.

More info on our v1 concept paper:

Authentication

Web2/Web3 Authentication System

On ZooGames, players have two primary methods to log in and access the platform:

  1. ZooGamesID: This is the traditional method where users create a unique identifier known as the ZooGamesID. It is a unique identifier that represents a player's identity on Zoo.Games. When a player starts a ZooGames compatible game, they enter their ZooGamesID to link their profile to the game. Once set up, users can log in using their ZooGamesID + 2FA to access all platform features.

  2. Instant PlayPass: For those who want to dive right into the action, the Instant PlayPass allows users to start playing games without initially setting up a ZooGamesID. Players simply input a username in-game (but not mandatory), and ZooGames takes care of the rest, automatically creating a primary and a mirror gaming address for them. This method is perfect for newcomers who want to explore the platform without any initial commitments. If they decide to take full ownership of their gaming progress and rewards later, they can easily link these temporary addresses to a newly created ZooGamesID.

Both methods are designed to provide flexibility and ease of access, catering to both seasoned gamers and newcomers alike.

Note that this image is provided for illustration purposes only
Concept Paper — ZooGames V1Medium
Logo

By Instant PlayPass

Allows users to quickly and seamlessly start playing games on ZooGames

Concept

Instant PlayPass is a streamlined onboarding feature for ZooGames. With just a username, players can instantly dive into games without initially setting up a ZooGamesID. Behind the scenes, two addresses (a primary and a mirror gaming address) are auto-generated for the player.

This lets newcomers freely explore games, earn tokens, and collect NFTs.

Technical Overview

Automated Address Generation Upon entering a game, users will only be required (or not — depending on the game developer’s chosen settings) to input a username. In the backend, the ZooGamesAPI will generate two distinct addresses for the user: a primary address and a corresponding gaming (mirror) address.

Gaming Experience & Asset Accumulation Users can immediately immerse themselves in the gaming environment, earning tokens, in-game chips, and NFTs, all of which are compatible across multiple blockchains, ensuring interoperability and flexibility.

Claiming Mechanism If a user decides to formalize their engagement on the platform, they will be provided with a unique Claiming URL on ZooGames. This URL directs them to a secure portal where they can establish a permanent ZooGamesID which will be linked to the account they have been utilizing.

Private Key Retrieval & Integration After the creation of their ZooGamesID, users will have the possibility to securely download the private key associated with their temporary primary address. This key can then be integrated as a secondary address within their newly minted ZooGames account, ensuring continuity and security of assets.

IMPORTANT NOTICE: Upon successful authentication via the PlayPass account, do not log out the user's session. Session termination could lead to irreversible loss of crypto-credentials and associated crypto assets for the player.

It's imperative to maintain session persistence until the user transitions and binds their account to a dedicated web3 Wallet.

Create in-game PlayPass Accounts

Grant your players instant access to your game using Instant PlayPass.

Create a new PlayPass account

POST API_END_POINT_URL/API_KEY/register/temp_user

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Path Parameters

Name
Type
Description

API_KEY*

String

Api Key

Request Body

Name
Type
Description

gameAddress*

Address

Address of Game/Project registered Primary Address

username*

String

Choose any temporary username you like. We suggest using a prefix like 'TMP_' followed by numbers, such as 'TMP_123456789'. You can also consider using the current timestamp

{
  success: true,
  data: {
    jwt: 'eyJhbGciOiJIUzI1NiIsInR5pXVCJ9.eyJ1c2VybmFtZSI61MDIxOTcxMjE2IiwicHJpbWFyeUFkZHJlc3MiOiIweDY1MkFhMjM1NWM3MDAzNjVhNUY4ZDI5YzFlOGY1NWFlRjI1RjAyQWYiLCJtaXJyb3JBZGRyZXNzIjoiMHgyZjAyOThhMDEyMjY4RkNiNDY4ZmM0OTE3MDI2NTk5OUQ4RWJmQ0ZhIiwibWlycm9yQmFsYW5jZSI6IjAiLCJjaGFpbklkIjo4ODgsImNyZWF0ZVRpbWUiOjE2OTUwMjE5ODE1MDksImF2YXRhcl91cmwiOm51bGwsImlzVG1wIjp0cnVlLCJhcHByb3ZhbCI6OTk5OTk5OTk5OSwicGxheVNlY29uZHMiOjk5OTk5OTk5OTksInN0YXJ0VGltZSI6MTY5NTAyMTk4MSwiZW5kVGltZSI6OTk5OTk5OTk5OSwiZ2FtZUFkZHJlc3MiOiIweDVEMkE4QjM2ODMyOTI0NDJmQUNhNTJlOUI2NTM3RmFhYWQwQUU1NzYiLCJpYXQiOjE2OTUwMjE5ODJ9.AI-xg0hdQ-4vwK8ffgBiuUXKIE1dMKl0TXU7ZFwYh6o',
    username: 'TMP_1695021971216',
    gameAddress: '0x5D2A8B3683292442fACa52e9B6537Faaad0AE576',
    primaryAddress: '0x652Aa2355c700365a5F8d29c1e8f55aeF25F02Af',
    mirrorAddress: '0x2f0298a012268FCb468fc49170265999D8EbfCFa'
  }
}
{
  "success": false,
  "message": "error message",
}

The returned JWT acts as a perpetual sign-in session with no expiration date and unlimited spending approval. Once this account type is created, players can enter the game using the JWT as their ongoing session.

Uncover the redeem code for the PlayPass account

When players decide to transition to a web3 wallet, they can claim their wallet credentials using a redeem code.

Provide a confidential redeem code, allowing users to register on Zoo.games

POST API_END_POINT_URL/API_KEY/reveal/mirrorRedeemCode

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Path Parameters

Name
Type
Description

API_KEY*

String

Api Key

Request Body

Name
Type
Description

jwt*

JWT String

a JWT string generated from the PlayPass account.

{
  success: true,
  data: {
    username: 'TMP_1695021971216',
    gameAddress: '0x5D2A8B3683292442fACa52e9B6537Faaad0AE576',
    primaryAddress: '0x652Aa2355c700365a5F8d29c1e8f55aeF25F02Af',
    mirrorAddress: '0x2f0298a012268FCb468fc49170265999D8EbfCFa',
    redeemCode: 'CD18-F930-57H2-756F',
    redeemUrl: 'https://zoo.games/signup?redeemCode=CD18-F930-57H2-756F'
  }
}
{
  "success": false,
  "message": "error message",
}

Users can use the provided Redeem Code to register on the Zoo.games Platform. Once registration is complete on Zoo.games, the Mirror (Game) Address will be connected to the newly registered account, and users can then access the Private Key of the PlayPass Primary Address.

After registering using the redeem code, all sessions associated with the PlayPass account will expire. Ensure you also disconnect them from the current session.

By ZooGamesID

Two-Factor Authentication

Concept

The player provides their ZooGamesID and 2FA token, and if the credentials are valid, the server grants access for the user to log in.

A user's session in the application has an expiration time of 120 minutes. After this period, the session will expire, and the user will need to log in again.

If the user wants to extend the session and prevent it from expiring, they can use the Keep-alive API. By making a request to the Keep-alive API within the session's duration, the session will be refreshed, and the expiration time will be extended.

To gain insights into how authentication works on Zoo.Games, you can explore our open-source Telegram AUTH web app. It will provide you with a clear understanding of the authentication process implemented on the Zoo.Games platform.

To ensure compatibility with the API, please note that only lowercase ZooGamesIDs are supported. When communicating with the API, please convert any uppercase letters in the ZooGames ID to lowercase. You can maintain the appearance of capital letters in your game, but the actual communication with the API should use lowercase characters.

To authenticate and handle login and logout functionality, you need to follow these steps:

Login and Logout

by installing the SDK and utilizing the signData() function, you can generate the SignedSignatureFromPayload (HMAC signature) for authentication purposes in the ZooGames API requests

Login API - To Login user and return JWT token as a session token

POST API_END_POINT_URL/API_KEY/session/login

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Path Parameters

Name
Type
Description

API_KEY*

String

API Key

Headers

Name
Type
Description

authorization*

String

eg: Bearer SignedSignatureFromPayload

Request Body

Name
Type
Description

username*

String

ZooGamesId

token*

String

6 digits of 2FA token

{
  "success": true,
  "data": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNyeXB0b2Zlbm5lYyIsInByaW1hcnlBZGRyZXNzIjoiMHg2QWI0OTljOEUyZjNDQmM5Qzk5MDM0YjZlMjkxMjE0OTIxMmJFNzcwIiwibWlycm9yQWRkcmVzcyI6IjB4ZTQyNzQxZjI4ZTE1YzU4NzkxMjlGZTVGNzQ5Zjc4NjIzZWU3MTIzNiIsIm1pcnJvckJhbGFuY2UiOiI1NTUuMSIsImNoYWluSWQiOiI4ODgiLCJ2ZXJpZnkyRkFTdWNjZXNzVGltZXMiOjQsImlhdCI6MTY1NjMxMTc4MH0.4EzwI54lVs_9zx2Qy-UhDsVb5PocHIDjxK0cCIxEZko"
}
{
  "success": false,
  "message": "error message",
  "data": {username, token}
}
Example of Login
import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'
import axios from 'axios';

// Initialized API KEY and SECRET KEY
const API_KEY = 'YourApiKey';
const SEC_KEY = 'YourSecretKey';

// Signing body data with HMAC signing
let body = {username: "myusername", token: "123456"};
let bodyMessage = JSON.stringify(body); 
let hmac = ApiKey.signData(bodyMessage, SEC_KEY); // hmac or SignedSignatureFromPayload  

// Request by Post Method //
let ret = await axios.post(`/api/${API_KEY}/session/login`, body, {headers:{Authorization: `Bearer ${hmac}`}});
console.log('ret', ret.data);

IMPORTANT NOTICE: If a player is authenticated through the PlayPass account, Avoid logging the user out. Such an action can result in the permanent loss of the users linked digital assets.

Logout API - To log out for already log in user

POST API_END_POINT_URL/API_KEY/session/logout

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Path Parameters

Name
Type
Description

API_KEY*

String

API Key

Headers

Name
Type
Description

authorization*

String

Bearer SignedSignatureFromPayload

Request Body

Name
Type
Description

jwt*

String

JWT token you got from Login API

{
  "success": true
}
{
  "success": false,
  "message" : "error message",
  "data": {jwt}
}
Example of Logout
import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'
import axios from 'axios';

// Initialized API KEY and SECRET KEY
const API_KEY = 'YourApiKey';
const SEC_KEY = 'YourSecretKey';

// Signing body data with HMAC signing
let body = {jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNyeXB0b2Zlbm5lYyIsInByaW1hcnlBZGRyZXNzIjoiMHg2QWI0OTljOEUyZjNDQmM5Qzk5MDM0YjZlMjkxMjE0OTIxMmJFNzcwIiwibWlycm9yQWRkcmVzcyI6IjB4ZTQyNzQxZjI4ZTE1YzU4NzkxMjlGZTVGNzQ5Zjc4NjIzZWU3MTIzNiIsIm1pcnJvckJhbGFuY2UiOiI1NTUuMSIsImNoYWluSWQiOiI4ODgiLCJ2ZXJpZnkyRkFTdWNjZXNzVGltZXMiOjQsImlhdCI6MTY1NjMxMTc4MH0.4EzwI54lVs_9zx2Qy-UhDsVb5PocHIDjxK0cCIxEZko"};
let bodyMessage = JSON.stringify(body); 
let hmac = ApiKey.signData(bodyMessage, SEC_KEY); // hmac or SignedSignatureFromPayload  

// Request by Post Method //
let ret = await axios.post(`/api/${API_KEY}/session/logout`, body, {headers:{Authorization: `Bearer ${hmac}`}});
console.log('ret', ret.data);

Keep-alive

The Keep-Alive feature allows users to extend the expiration time of their session. By making a request to the Keep-Alive API endpoint within the session duration, users can refresh the session and prevent it from expiring.

Keep-alive API - To keep alive (Persistent Session) logged in user

POST API_END_POINT_URL/API_KEY/session/keepAlive

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Path Parameters

Name
Type
Description

API_KEY*

String

API Key

Headers

Name
Type
Description

authorization*

String

eg: Bearer SignedSignatureFromPayload

Request Body

Name
Type
Description

username*

String

ZooGameId

jwt*

String

JWT token you get from Login API

{
  "success": true,
  "data": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNyeXB0b2Zlbm5lYyIsInByaW1hcnlBZGRyZXNzIjoiMHg2QWI0OTljOEUyZjNDQmM5Qzk5MDM0YjZlMjkxMjE0OTIxMmJFNzcwIiwibWlycm9yQWRkcmVzcyI6IjB4ZTQyNzQxZjI4ZTE1YzU4NzkxMjlGZTVGNzQ5Zjc4NjIzZWU3MTIzNiIsIm1pcnJvckJhbGFuY2UiOiI1NTUuMSIsImNoYWluSWQiOiI4ODgiLCJ2ZXJpZnkyRkFTdWNjZXNzVGltZXMiOjQsImlhdCI6MTY1NjMxMTc4MH0.4EzwI54lVs_9zx2Qy-UhDsVb5PocHIDjxK0cCIxEZko"
}
{
  "success": false,
  "messagge": "error message",
  "data": {username, jwt}
}
Example of Keep-alive
import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'
import axios from 'axios';

// Initialized API KEY and SECRET KEY
const API_KEY = 'YourApiKey';
const SEC_KEY = 'YourSecretKey';

// Signing body data with HMAC signing
let body = {username: "myusername", jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNyeXB0b2Zlbm5lYyIsInByaW1hcnlBZGRyZXNzIjoiMHg2QWI0OTljOEUyZjNDQmM5Qzk5MDM0YjZlMjkxMjE0OTIxMmJFNzcwIiwibWlycm9yQWRkcmVzcyI6IjB4ZTQyNzQxZjI4ZTE1YzU4NzkxMjlGZTVGNzQ5Zjc4NjIzZWU3MTIzNiIsIm1pcnJvckJhbGFuY2UiOiI1NTUuMSIsImNoYWluSWQiOiI4ODgiLCJ2ZXJpZnkyRkFTdWNjZXNzVGltZXMiOjQsImlhdCI6MTY1NjMxMTc4MH0.4EzwI54lVs_9zx2Qy-UhDsVb5PocHIDjxK0cCIxEZko"};
let bodyMessage = JSON.stringify(body); 
let hmac = ApiKey.signData(bodyMessage, SEC_KEY); // hmac or SignedSignatureFromPayload  

// Request by Post Method //
let ret = await axios.post(`/api/${API_KEY}/session/keepAlive`, body, {headers:{Authorization: `Bearer ${hmac}`}});
console.log('ret', ret.data);

Keep-Alive helps enhance user experience by reducing the need for repeated logins and provides convenience during extended usage periods.

Approve

Approve API enables the creation of in-game vZOO transactions. However, to ensure security and validate the transaction, players are required to re-enter their 2FA (Two-Factor Authentication) credentials.

If the 2FA validation fails or is not provided by the player, the transaction will not be approved and will result in a failure.

Approve API - To request vZOO spending from user mirror address

POST API_END_POINT_URL/API_KEY/session/approve

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Path Parameters

Name
Type
Description

API_KEY*

String

API Key

Headers

Name
Type
Description

authorization*

String

Bearer SignedSignatureFromPayload

Request Body

Name
Type
Description

username*

String

ZooGamesId

jwt*

String

JWT token you got from Login API

approval*

Decimal

vZOO amount for approval (e.g. 0.1)

playSeconds*

Integer

approval expiry in (e.g. 3600)

gameAddress

Address

Address of Game/Project registered Primary Address

token*

String

6 digits of 2FA token

{
    "success":true,     
    "data":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNyeXB0b2Zlbm5lY3Rlc3QiLCJwcmltYXJ5QWRkcmVzcyI6IjB4NUQyQThCMzY4MzI5MjQ0MmZBQ2E1MmU5QjY1MzdGYWFhZDBBRTU3NiIsIm1pcnJvckFkZHJlc3MiOiIweDkxNGUwQ0U0RjQxMzJlQWM4OEMxNDViNkIyOTQ1MTIwNTZCYkZFMzkiLCJtaXJyb3JCYWxhbmNlIjoiNjAuMzUiLCJjaGFpbklkIjo5OTksInZlcmlmeTJGQVN1Y2Nlc3NUaW1lcyI6NCwiY3JlYXRlVGltZSI6MTY1NzA4ODk4MTc5NiwiYXZhdGFyIjoiZGF0YTppbWFnZS9qcGVnO2Jhc2U2NCwvOWovNEFBUVNrWkpSZ0FCQVFBQUFRQUJBQUQvNGdJb1NVTkRYMUJTVDBaSlRFVUFBUUVBQUFJWUFBQUFBQVF3QUFCdGJuUnlVa2RDSUZoWldpQUFBQUFBQUFBQUFBQUFBQUJoWTNOd0FBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFRQUE5dFlBQVFBQUFBRFRMUUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBbGtaWE5qQUFBQThBQUFBSFJ5V0ZsYUFBQUJaQUFBQUJSbldGbGFBQUFCZUFBQUFCUmlXRmxhQUFBQmpBQUFBQlJ5VkZKREFBQUJvQUFBQUNoblZGSkRBQUFCb0FBQUFDaGlWRkpEQUFBQm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JFUWhFUkVJVVJwclV0djFQYVlhNmltWVh1YU90aDJ1MUU3bTBqang1ODFMb2lFSWlJaENJaUlRaUlpRUlpSWhDSWlJUWlJaUVLTDFEcUczNmJ0VTFmWHpzWnNOSmpqTHUxSzdrMW81NVBseEtJaUVMLy8yUT09IiwiaWF0IjoxNjYxNzg5ODc5LCJhcHByb3ZhbCI6IjAuMSIsInBsYXlTZWNvbmRzIjoiMzYwMCIsInN0YXJ0VGltZSI6MTY2MTc5MDAxNSwiZW5kVGltZSI6MTY2MTc5MzYxNSwiZ2FtZUFkZHJlc3MiOiIweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAifQ.TF0AqIniXLg7rEhVOurFnM7MrTTvosXCYpVn0oorgBc"
}
{
  "success": false,
  "message" : "error message",
  "data" : {username, token, jwt, approval, plaSeconds, gameAddress}
}
Example of Approve
import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'
import axios from 'axios';

// Initialized API KEY and SECRET KEY
const API_KEY = 'YourApiKey';
const SEC_KEY = 'YourSecretKey';

// Signing body data with HMAC signing
let body = {username: "myusername", "token":"123456", jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNyeXB0b2Zlbm5lYyIsInByaW1hcnlBZGRyZXNzIjoiMHg2QWI0OTljOEUyZjNDQmM5Qzk5MDM0YjZlMjkxMjE0OTIxMmJFNzcwIiwibWlycm9yQWRkcmVzcyI6IjB4ZTQyNzQxZjI4ZTE1YzU4NzkxMjlGZTVGNzQ5Zjc4NjIzZWU3MTIzNiIsIm1pcnJvckJhbGFuY2UiOiI1NTUuMSIsImNoYWluSWQiOiI4ODgiLCJ2ZXJpZnkyRkFTdWNjZXNzVGltZXMiOjQsImlhdCI6MTY1NjMxMTc4MH0.4EzwI54lVs_9zx2Qy-UhDsVb5PocHIDjxK0cCIxEZko","approval":0.1,"playSeconds":3600,"gameAddress": "0xd207d371d7a24F65cE9CcB3C78B58f27DF279Eb2"};
let bodyMessage = JSON.stringify(body); 
let hmac = ApiKey.signData(bodyMessage, SEC_KEY); // hmac or SignedSignatureFromPayload  

// Request by Post Method //
let ret = await axios.post(`/api/${API_KEY}/session/approve`, body, {headers:{Authorization: `Bearer ${hmac}`}});
console.log('ret', ret.data);

Status

The Status API returns the current JWT Payload and verifies whether their JWT is eligible for use in the Settlement API.

Status API - Returns current JWT Payload and verifies current JWT

POST API_END_POINT_URL/API_KEY/session/status

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Path Parameters

Name
Type
Description

API_KEY*

String

API Key

Headers

Name
Type
Description

authorization*

String

Bearer SignedSignatureFromPayload

Request Body

Name
Type
Description

jwt*

String

JWT token you got from Login API

Query String

Name
Type
Description

without_avatar

Boolean

true: To set "avatar" property as "null" to reduce the returning data

{
    "success":true,
    "data":
        {
            "username":"zoogametester",
            "primaryAddress":"0x8D2A8B3683292442fACa52e9B6537Faaad0AE765",
            "mirrorAddress":"0x524e0CE4F4132eAc88C145b6B294512056BbFE23",
            "mirrorBalance":"55.55",
            "chainId":999,
            "verify2FASuccessTimes":3,
            "createTime":1657088981796,
            "avatar":"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAAAAQwAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAAHRyWFlaAAABZAAAABRnWFlaAAABeAAA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pAIwRkKAuGirLcL1TXeSkYKqneHh43bRHDa78cRnuSuEse7XAy4j39eqdHLC6wujrSw01p2NszAKyo+cnPcT9n2Dd5rbVQAAADgFVPwx+G2xzzPX39khREROpEVmrpYa2lkpqiNskcjS1zXDIIPEFXkXL2Ne0tdkULz5q/Rl00ZeBX2wTGja/bhnjyTCe5358CFiO1nrG8nqaaonccYLaSHBP8oyvRj42SDD2hw9atx0sEX1cLG+AUMwyXAcGutkTn28wnA8tFgbLz5BoTWt7eHT0tQQd+3VzY9xOfcp+g6FLtKAa26QQd7YmF58zhdpG7gqp0Ry5F9ugt3uuCQVzei6FbHCQ6rq6upPMbYaPcM+9T1F0a6TogNm0xSEc5syf3ErakS/DsO0Sfme2SLrEpbVQUTQ2lo4YWjkxgb8FlBrRwAHsVUXbIY2bLQPki5REROpEREQhEREIURprUtv1PaYa6imYXuaOth2u1E7m0jjx581LoiEIiIhCIiIQiIiEIiIhCIiIQiIiEKL1DqG36btU1fXzsZsNJjjLu1K7k1o55PlxKIiEL//2Q==",
            "iat":1660836160,
            "isPlayPass": false,
            "allowance":0
        }
}
{
  "success": false,
  "message" : "error message",
  "data" : {jwt}
}
Example of Status
import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'
import axios from 'axios';

// Initialized API KEY and SECRET KEY
const API_KEY = 'YourApiKey';
const SEC_KEY = 'YourSecretKey';

// Signing body data with HMAC signing
let body = {jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNyeXB0b2Zlbm5lYyIsInByaW1hcnlBZGRyZXNzIjoiMHg2QWI0OTljOEUyZjNDQmM5Qzk5MDM0YjZlMjkxMjE0OTIxMmJFNzcwIiwibWlycm9yQWRkcmVzcyI6IjB4ZTQyNzQxZjI4ZTE1YzU4NzkxMjlGZTVGNzQ5Zjc4NjIzZWU3MTIzNiIsIm1pcnJvckJhbGFuY2UiOiI1NTUuMSIsImNoYWluSWQiOiI4ODgiLCJ2ZXJpZnkyRkFTdWNjZXNzVGltZXMiOjQsImlhdCI6MTY1NjMxMTc4MH0.4EzwI54lVs_9zx2Qy-UhDsVb5PocHIDjxK0cCIxEZko"};
let bodyMessage = JSON.stringify(body); 
let hmac = ApiKey.signData(bodyMessage, SEC_KEY); // hmac or SignedSignatureFromPayload  

// Request by Post Method //
let ret = await axios.post(`/api/${API_KEY}/session/status`, body, {headers:{Authorization: `Bearer ${hmac}`}});
console.log('ret', ret.data);

Login and Approve

When users interact with the Login and Approve API, they are required to provide their login credentials, ZooGamesID and 2FA, to authenticate themselves and gain access to their account. Upon successful authentication, users can proceed to approve in-game transactions.

If the 2FA validation fails or is not provided by the player, the transaction will not be approved and will result in a failure.

Login and Approve API - to Login and Approve at once

POST API_END_POINT_URL/API_KEY/session/loginAndApprove

SDK Preparation

You need to prepare for SignedSignatureFromPayload by

Installing zoo-game-sdk by npm install zoo-game-sdk

Import SDK by import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'

Signing by SDK

let bodyMessage =JSON.stringify(payload);

let hmac = ApiKey.signData(bodyMessage, SEC_KEY);

*Use "hmac" as SignedSignatureFromPayload

Path Parameters

Name
Type
Description

API_KEY*

String

API KEY

Headers

Name
Type
Description

authorization*

String

Bearer SignedSignatureFromPayload

Request Body

Name
Type
Description

username*

String

ZooGamesId

token*

String

6 digits of 2FA token

approval*

Decimal

vZOO amount for approval (e.g. 0.1)

playSeconds*

Integer

approval expiry in (e.g. 3600)

gameAddress*

Address

Address of Game/Project registered Primary Address

{
    "success":true,     
    "data":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNyeXB0b2Zlbm5lY3Rlc3QiLCJwcmltYXJ5QWRkcmVzcyI6IjB4NUQyQThCMzY4MzI5MjQ0MmZBQ2E1MmU5QjY1MzdGYWFhZDBBRTU3NiIsIm1pcnJvckFkZHJlc3MiOiIweDkxNGUwQ0U0RjQxMzJlQWM4OEMxNDViNkIyOTQ1MTIwNTZ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": false,
  "message" : "error message",
  "data": {username, token, approval, playSeconds, gameAddress}
}
Example of Login and Approve
import * as ApiKey from 'zoo-game-sdk/src/auth/apikey/index'
import axios from 'axios';

// Initialized API KEY and SECRET KEY
const API_KEY = 'YourApiKey';
const SEC_KEY = 'YourSecretKey';

// Signing body data with HMAC signing
let body = {username: "myusername", "token":"123456", "approval":0.1, "playSeconds":3600, "gameAddress": "0xd207d371d7a24F65cE9CcB3C78B58f27DF279Eb2"};
let bodyMessage = JSON.stringify(body); 
let hmac = ApiKey.signData(bodyMessage, SEC_KEY); // hmac or SignedSignatureFromPayload  

// Request by Post Method //
let ret = await axios.post(`/api/${API_KEY}/session/loginAndApprove`, body, {headers:{Authorization: `Bearer ${hmac}`}});
console.log('ret', ret.data);

ZooGames AUTH webapp for Telegram
Logo