ton-org
game-engines-sdk
TypeScript

TON blockchain bindings and utilities for game engines

Last updated Jun 30, 2026
63
Stars
9
Forks
2
Issues
0
Stars/day
Attention Score
30
Language breakdown
TypeScript 98.5%
JavaScript 1.5%
Files click to expand
README

game-engines-sdk

TON blockchain bindings and utilities for game engines:

Getting started

Installation:
# for Phaser npm install --save @ton/phaser-sdk@beta

for Cocos

npm install --save @ton/cocos-sdk@beta

for Cocos

npm install --save @ton/vanilla-sdk@beta

Creating GameFi instance:

// creation options described in the related section const gameFi = await GameFi.create()

Connecting wallet:

// create the UI scene class UiScene extends Phaser.Scene {} const uiScene = new UiScene();

// add the connect button to the scene // all options described in the related section const button: Container = gameFi.createConnectButton({ scene: uiScene })

Watching wallet connection:

gameFi.onWalletChange((wallet: Wallet | null) => {     // do the logic depending weather wallet is null or not })
This can be used for:
  • Watch the wallet state and reflect it on the game UI
  • Restore connection with previously connected user wallet after app reloads

What SDK should I use?

Engine specific features can be included to related SDKs. For example, phaser-sdk has build-it UI for connecting wallet. There is almost no differences between SDKs features right now.

Start with SDK of related engine if you use one. Use @ton/vanilla-sdk otherwise.

GameFi methods & props

GameFi static methods:

| Method | Description | | -------- | -------- | | create | creates a GameFi instance |

GameFi instance methods:

| Method | Description | | -------- | -------- | | createConnectButton | creates a button to connect a wallet. | | connectWallet | connect wallet manually (without build-in UIs) | | onWalletChange | watch weather wallet was connected or disconnected | | disconnectWallet | disconnect wallet manually (without build-in UIs) | | buyWithTon | buy from in-game shop with TON | | buyWithJetton | buy from in-game shop with jetton | | transferTon | transfer TON to another wallet address | | transferJetton | transfer jetton to another wallet address | | openNftCollection | open NFT collection contract | | openNftSale | open NFT collection contract | | openNftItem | open NFT item contract | | openNftItemByIndex | open NFT item contract using its index | | openSbtCollection | open SBT collection contract | | openJetton | Open Jetton contract | | openJettonWallet | Open Jetton Wallet contract |

GameFi instance props:

| Prop | Description | | -------- | -------- | | assetsSdk | asset-sdk instance in case you need to use it directly | | walletConnector | wallet connector instance in case you need to use it directly | | wallet | user's connected wallet | | walletAccount | user's connected account | | walletAddress | user's connected wallet address | | merchantAddress | in-game shop's address to receive TON | | merchantJettonAddress | in-game shop's jetton used as in-game currency |

Use cases

To learn complex use cases:

References

The full typedoc references.

© 2026 GitRepoTrend · ton-org/game-engines-sdk · Updated daily from GitHub