Skip to main content

Upgrading the Unity SDK

Version 4.0.0 of the Unity SDK includes many changes from the previous version.

Changed methods

These methods have changed in version 4.0.0:

Connecting to wallets

Unity applications no longer use the TezosSDK.Tezos.Wallet.WalletProvider object to connect to wallets. See Connecting accounts.

Getting wallet information

Unity applications no longer use the TezosSDK.Tezos.Wallet.WalletProvider object to get information about the connected wallet.

Instead, use TezosAPI.GetBalance() to get the balance of the connected account and TezosAPI.GetWalletConnectionData() or TezosAPI.GetSocialLoginData() to get information about the connected wallet.

Signing messages

The way that the SDK handles signing messages has changed. For an example, see Signing messages.

Contracts

Version 3 included a built-in FA2 token contract and convenience methods for using it. This contract and the convenience methods are not provided in version 4, so you must deploy your own contract and call it directly, without the convenience methods. The TezosSDK.Tezos.API.Models.TokenContract object is no longer available.

If you need an FA2 contract to manage tokens, templates are available in the SmartPy and LIGO online IDE.

Deploying contracts

The TokenContract.Deploy() method and the TokenContract.address variable are not available in version 4.0.0.

In most cases, you deploy a contract from another client and use that contract through the Unity SDK. See Deploying smart contracts.

However, if you want to deploy a contract from the Unity SDK, you can use the TezosAPI.DeployContract method.

Calling contracts

Version 4.0.0 of the SDK does not include the TezosManager.Instance.Tezos.TokenContract.Mint() method or the TezosManager.Instance.Tezos.TokenContract.Transfer() method.

To call contracts with the SDK, see Calling contracts with the Unity SDK.

Changing the RPC node

It's easier to change the RPC node in version 4.0.0 because you can edit the TezosConfig scriptable object directly at Assets/Tezos/Resources/TezosConfig.asset and set the RPC URL in the Rpc Url Format field. See Changing the RPC node.