Gaming sdk


xRaise wallet allows games to integrate blockchain to the gameplay.

Solution includes integrated wallet where users can create account without leaving the browser.

xRaise wallet supports background sessions so user can play without interruptions for transaction signing

Quick setup


Install xRaise Wallet connector package

npm i xraise-gaming-sdk


Smart contracts

Games are required to launch NFTs for your game entities like inventory items, skins, achevements. These smartcontracts are typical and can be based on ready-made ones. Read more about game smartcontracts deployment


Ask user to connect the wallet

  // GAME_CONTRACT_1_ADDRESS calls will not require confirmations during session
  await gamingSdk.user.connect({
    sessionContracts: [GAME_CONTRACT_1_ADDRESS] 

Dealing with inventory

Request user inventory items

  const userInventory = await gamingSdk.user.current.inventory.get([CATEGORY_NFT_ID]);
  const userInventory = await gamingSdk.user.current.inventory.get([CATEGORY_NFT_ID_1, CATEGORY_NFT_ID_2]);
  await[CATEGORY_NFT_ID], (newItems) => {...});
  await[CATEGORY_NFT_ID_1, CATEGORY_NFT_ID_2], (newItems) => {...});

Add user items

  const userInventory = await gamingSdk.user.inventory.get();
  await, 1);
  await, 1);
  await, 1);
  await gamingSdk.user.inventory.burn(NFT_ADDRESS, 1);

Dealing with achevements

  const achevements = await gamingSdk.user.current.achevements.get(ACHIEVEMENT_CATEGORY_NFT_ADDRESS);
  await => {...});

Managing score

  const score = await gamingSdk.user.current.score.get(user_id, RESOURCE_NFT_ADDRESS);

Opening lootboxes

  const newItems = await;

Managing subscriptions aka auto payments

  const newSubscription = await gamingSdk.user.current.subscription.create(SUBSCRIPTION_NFT_ADDRESS, SubscriptionPeriod.Month);
  const subscription = await gamingSdk.user.current.subscription.get(SUBSCRIPTION_NFT_ADDRESS);
  await, (newSubscription) => {...});
  const subscription = await gamingSdk.user.subscription.get(userAddress, SUBSCRIPTION_NFT_ADDRESS);

Dealing with token streams

  const newTokenStream = await gamingSdk.user.current.token_stream.create(TOKEN_ADDRESS, CONTROLLER_ADDRESS, { limit: parseUnits("3.0") });
  const userTokenStreams = await gamingSdk.user.current.token_stream.get(streamId);
  await gamingSdk.user.current.token_stream.stop(streamId);
  await => {...});
  const subscription = await gamingSdk.user.subscription.get(userAddress, SUBSCRIPTION_NFT_ADDRESS);

Calling smartcontracts

Custom smartcontracts can be used by extracting ethers.js provider for users

  const provider = await gamingSdk.user.current.provider();
  const contract = new ethers.Contract(contractAddress, abi, provider);