Upgrading the Unity SDK
Version 4.0.2 of the Unity SDK includes breaking changes from the previous major 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 these methods:
TezosAPI.GetConnectionAddress(): Returns the address of the currently connected accountTezosAPI.GetBalance(): Returns the balance of the connected account in tez (for Tezos connections) or XTZ (for Etherlink connections)TezosAPI.GetWalletConnectionData()orTezosAPI.GetSocialLoginData(): Returns 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.
The contract itself is still supported, so if you have a copy of the contract deployed, you can continue to use it.
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.
Managing tokens
The SDK no longer includes convenience methods for getting token balances or transferring tokens. To work with tokens, see Managing tokens.
Changing the RPC node
The way that the SDK selects the RPC node to use changed in version 4.0.0 and again in version 4.0.2.
In version 4.0.2, you control the RPC node to send requests to by editing the TezosConfig scriptable object directly at Assets/Tezos/Resources/TezosConfig.asset.
In this object, you set RPC URLs to use for Tezos Mainnet and a test network.
Then you can use the Network dropdown list to switch between Mainnet and the test network.
See Changing the RPC node and TezosConfig scriptable object.
Also, the DataProviderConfigSO scriptable object is no longer used; all of its information has been moved to the TezosConfig scriptable object.