Gaming Integration Guide

Integrate web3 features into your game without sacrificing player experience.

This guide covers the products and functionality for games integrating with Shinami.

Shinami Products

Shinami has a suite of products for gaming:

  • Node Service: enterprise-grade infrastructure to read and write to the Sui blockchain
  • Gas Station: abstract gas fees from your player experience by sponsoring their transactions
  • In-App Wallets: fully abstract web3 from your player experience (third-party wallet connections, gas fees, signing popups, seed phrases)

🚧

Pre-Integration

Prior to integrating with Shinami, you should create and deploy Sui Move smart contracts to manage your on-chain assets (characters, items, etc.) and game logic.

Integration

Shinami’s APIs provide the functionality to manage in-app wallets (accounts), and read/write to the Sui blockchain. All APIs are protected by a Shinami access key, which you can create from your account dashboard.

In-App Wallet API

Shinami’s in-app wallets allow players to interact with on-chain assets seamlessly. In-app wallets are under the shared custody of your game and Shinami. Shinami has built a proprietary compute-only service with no state persistence and strict input/output policies to allow both parties to transact together securely.

-shinami_key_createSession: for security purposes, you must generate a session token before you create a wallet, sign transactions, or execute transactions. Session tokens expire after 10 minutes.

  • shinami_wal_createWallet: programmatically generates a unique wallet for a player.
  • shinami_wal_getWallet: retrieve a player’s wallet address based on their id.
  • shinami_wal_executeGaslessTransaction: sponsors / signs / executes a gasless transaction from a wallet. This is a convenient end-to-end method for submitting transactions to the chain.
  • shinami_wal_signTransaction: signs a transaction. This is a low-level API - it requires integration with Gas Station API and Sui API for transaction sponsorship and execution. This method gives you more control over how you want to submit your transactions to Sui.

You can find more info on these methods in our In-App Wallet API page.

Sui API

Shinami’s Sui API is the easiest way to read and write to the Sui blockchain. These are the most common methods for gaming use cases:

Read API

  • sui_getObjectsOwnedByAddress: can be used on the in-app wallet address to list its contents.
  • sui_getTransactions: can be used to get the transaction history of in-app wallets.
  • sui_subscribeEvent: can be used to subscribe to real-time events regarding in-app wallets, such as Imports.

Transaction Builder API

Used to build transactions that interact with your on-chain assets and custom smart contracts. We have another guide for more details on building Sui transactions.

  • sui_dryRunTransaction: executes a dry run of a transaction without creating an actual transaction or consuming gas
  • sui_moveCall: call a specific function from your smart contract. This could include minting, merging or updating on-chain assets.
  • sui_transferObject: create an unsigned transaction to transfer an object from one address to another. You can use this method for Exports.
  • sui_batchTransaction: create an unsigned batch transaction. You can increase efficiency by putting multiple transactions into one.

Write API

  • sui_executeTransaction: executes a signed transaction.

📘

Note:

If you use the high-level shinami_executeGaslessTransaction from the In-App Wallet API, you won’t need to interact with the Sui Executor API directly.

You can find more info on these methods in our Sui API page.

Gas Station API

Shinami gas station facilitates sponsored transactions. This is the primary method:

  • gas_sponsorTransaction: send a transaction to the gas station to request gas sponsorship

📘

Note:

If you use the high-level shinami_executeGaslessTransaction from the In-App Wallet API, you won’t need to interact with the Gas Station API directly.

You can find more info on these methods in our Gas Station API page.