Skip to content

Releases: thirdweb-dev/unity

v5.0.1

09 Sep 15:08
af37b3b
Compare
Choose a tag to compare

What's Changed

  • Support for base64 token URIs in the context of getting NFTs from a contract that stores raw base64 metadata using our extensions.
  • NFTMetadata now also returns a properties object alongside existing attributes.

v5.0.0

05 Sep 04:36
fb74728
Compare
Choose a tag to compare

Stable Release - Thirdweb Unity SDK v5

With the release of our .NET SDK v2, the next generation of our Unity SDK is finally out of beta - no more platform specific updates!

This version comes with long-awaited features and various speed, stability and performance improvements.

This is a major version upgrade that comes with API breaking changes, be sure to cleanly remove old SDK files before upgrading.

Ecosystem Wallets

An ecosystem wallet is your own managed in-app wallet service that allows you to create a branded wallet and login system, and allow any number of partners to spin up in-app wallets. End users that create in-app wallets in your partner applications (either with email, phone number, socials or your own custom authentication) will receive one account and wallet address that they can access across all apps and games in your ecosystem.

Ecosystem Wallets use an enclave backend to handle private keys and signing, remaining non-custodial and secure, while also offloading the otherwise sharded wallet client side cryptographic work to a single http request - the ultimate cross-platform friendly account system.

You may upgrade these Ecosystem Wallets to Smart Wallets as you would any other wallet. The API is extremely similar to our In-App Wallets', and in some places simplified as well due to the streamlined infrastructure that powers it.

We've also reworked our login flows to increase speed and performance across the board, it's time to move on from external wallets (or just link them to our embedded wallets from now on through our Unified Identity system!)

Automatic Smart Wallet Network Switching

Given how our new SDK is structured, where no chain id is necessarily stored in the sdk or wallet's state, you may interact with any chain at will easily, setting up contracts or low level transactions across multiple chains and using a single wallet to execute them all.

Such functionality is now available seamlessly through our Smart Wallet offering. Simply create a smart wallet on any initial chain, and interact with any contract or send any transaction using another chain id - the smart wallet will automatically switch to that chain!

Do note that if you are overriding the default account factory in your connection parameters, that account factory must be deterministically deployed across the chains you are interacting with.

Unlocking low level transaction flows and zkSync specific flows

The ThirdwebTransaction.Create inputs have been simplified, removing redundant chain id parameters.
We've also made it simpler to create low level transactions by adding ThirdwebTransactionInput constructors that take in simpler types, and made zkSync transactions go through the EIP712 transaction flow regardless of whether you use a paymaster or not - this means you can override zkSync specific transaction variables like gas per pubdata and we'll still route your transaction through the 712 flow. If none of this made sense to you, don't worry, these are low level uncommon use cases.

Miscellaneous

[Utils] Added Utils.GetAddressFromENS and Utils.GetENSFromAddress - more info about ENS here.
[Utils] Added Utils.IsDeployed as a standalone way to check if there is contract code at a specified address.
[AA] CallGasLimit UserOp value now accepts user estimated or manual gas limits as overrides automatically if it's above bundler esimated callGasLimit.
[RPC] Improved response time, batching and caching behavior.

Unity-Specific

[ThirdwebManager] Added EcosystemWalletOptions as a parameter for when connecting to WalletProvider.EcosystemWallet.
[ThirdwebManager] Added EcosystemWalletModal prefab - similar to InAppWalletModal, will spawn if using ThirdwebManager.ConnectWallet with the respective wallet provider and otp-based authentication // fully customizeable, as are all things thirdweb. You may still opt to use our lower level .NET APIs and create your own flows.
[Extensions] Added Unity-specific extension for the NFT type - NFT.GetNFTSprite will return a Sprite loaded with your NFT's image.

Mandatory - Various Fixes & Performance Improvements

No, really. We're serious.

What's Next?

Now that the core is stable, we want to listen to your feedback, improve on all of it while also continuing to add features and unlock more functionality to help game developers, studios and publishers across the globe integrate the best tech ever created - blockchain tech.

UI Components are next, expect Scene_Playground to be updated as we roll those out - first up, production ready, fully featured Connect.

Support

https://thirdweb.com/support

v4.20.1

30 Aug 15:05
8d1183f
Compare
Choose a tag to compare

What's Changed

  • [Cross-Platform] Added support for new chains.

This patch also removes a duplicate DLL and incomplete third party prefabs making the import process in Unity 2021 a little easier.

v5.0.0-beta.4

20 Aug 08:10
9224507
Compare
Choose a tag to compare
v5.0.0-beta.4 Pre-release
Pre-release

What's Changed

Support for Account Abstraction 0.7.0 (EntryPoint 0.7.0)

You may now opt to use our new Account Factories that are built on top of the 0.7.0 ERC-4337 standard release, by passing Constants.ENTRYPOINT_ADDRESS_V07 as your entryPoint parameter in SmartWallet.Create or through the ThirdwebManager's ConnectWallet function. Note that we will continue supporting AA 0.6.0 - so no rush.

Among various other things, this unlocks:

  • Improved gas costs when interacting with Smart Wallets due to packed UserOp structs and more changes.
  • Improved gas limit estimations and faster simulation.
  • Token Paymasters - though not live on 0.7 until a little later, the API has been exposed to pass a TokenPaymaster (enum) when creating a Smart Wallet and choose which ERC20 you want users to pay gas with. This is an alternative to the default gasless flow where you sponsor gas for your users.

We've also added support for Abstract Testnet's native account abstraction (ZkSync-based chain).

Authentication

The new API for authenticating with your backend through SIWE in a single call looks like this now.

public static async Task<T> Authenticate<T>(
        this IThirdwebWallet wallet,
        string domain,
        BigInteger chainId,
        string authPayloadPath = "/auth/payload",
        string authLoginPath = "/auth/login",
        string authPayloadMethod = "GET",
        string authLoginMethod = "POST",
        bool separatePayloadAndSignatureInBody = false,
        IThirdwebHttpClient httpClientOverride = null
)

We've made it a little more flexible so you can hopefully get rid of any custom authentication code you might have and use this helper instead to unlock backend thirdweb auth with any wallet easily.

We've also fixed an issue with some older variants of Smart Wallet factories which resulted in "Invalid SIgnature" being thrown upon personal signing (and by extension, authenticating).

API Improvements

  • Low Level - Added IThirdwebWallet.ExecuteTransaction support for external and smart wallets to execute raw low level transaction input rather than going through ThirdwebTransaction.
  • Low Level - Simplified the ThirdwebTransactionInput by adding a constructor with user friendly types.
  • Mid Level - Added ThirdwebTransaction.Prepare, allowing you to have a quick way to estimate, simulate and populate a transaction without sending it.
  • High Level - Deprecated Utils.FetchThirdwebChainAsync, please use Utils.GetChainMetadata as the former will be removed in a future version.

General Improvements

  • Stricter coding standards were implemented, making sure the core won't fail you regardless of which .NET version or platform you're on.
  • Improved performance and stability across the board.
  • Various minor bugfixes were implemented and a couple properties were renamed to improve DX.

.NET Docs: https://portal.thirdweb.com/dotnet
Unity v5 Docs: https://portal.thirdweb.com/unity/v5

v5.0.0-beta.3

13 Aug 00:00
8ddedb6
Compare
Choose a tag to compare
v5.0.0-beta.3 Pre-release
Pre-release

What's Changed

Unity 6.0.0 Preview, SIWE as a login method, Account Linking

  • Added support for Unity 6.0.0+ Preview (Unity 2023 Tech Stream 3)
  • Added SIWE (Sign In With Ethereum) as an additional login provider for In-App Wallets.
// The external wallet you want to login with
var myExternalWallet = await PrivateKeyWallet.Generate(client: Client); // for simplicity, using generated wallet

// Setup auth with SIWE
var siweOptions = new InAppWalletOptions(authprovider: AuthProvider.Siwe, siweSigner: myExternalWallet);

// Setup connect options with chain ID
var connectOptions = new WalletOptions(provider: WalletProvider.InAppWallet, chainId: 421614, inAppWalletOptions: siweOptions);

// Login with SIWE!
var siweInAppWallet = await ThirdwebManager.Instance.ConnectWallet(connectOptions);
var address = await siweInAppWallet.GetAddress();
  • Added ability to link accounts, creating a Unified Identity across email, phone, social and other authentication options.
// Your main InAppWallet account, already authenticated and connected
InAppWallet mainInAppWallet = ...

// An InAppWallet with a new auth provider to be linked to the main account, not connected
InAppWallet walletToLink = await InAppWallet.Create(client: Client, authProvider: AuthProvider.Telegram);

// Link Account - Headless version
var linkedAccounts = await mainInAppWallet.LinkAccount(walletToLink: walletToLink);

// Link Account - Unity wrapper version
var linkedAccounts = await ThirdwebManager.Instance.LinkAccount(mainInAppWallet, walletToLink);

// You can also fetch linked accounts at any time
List<LinkedAccount> linkedAccounts = await mainInAppWallet.GetLinkedAccounts();

The LinkAccount API requires the parameters you typically use to login with a normal InAppWallet. It will authenticate the new wallet and link it directly to the main wallet. This makes it simple to have multiple identities tied a single evm-compatible account.

Miscellaneous

  • Performance and speed improvements for OTP based login methods.
  • Added caching for Utils.FetchThirdwebChainDataAsync.
  • Added Utils.IsEip155Enforced to check whether a chain enforces EIP 155.
  • Added smarter transaction gas fee defaults based on whether chain supports 1559.
  • ThirdwebContract.Read and ThirdwebContract.Write can now take in full or partial method signatures:
    • var name = await contract.Read<string>(method: "name", ...) still works.
    • var name = await contract.Read<string>(method: "function name() view returns (string)", ...) now also works.
    • var name= await contract.Read<string>(method: "name() view returns (string)", ...) now also works.
    • var result = await contract.Write(..., method: "claim(address, uint256, address, uint256, (bytes32[], uint256, uint256, address), bytes)", ...) now also works.
    • We still recommend using our awesome extensions for common standards such as contract.DropERC20_Claim to make life easier!
  • Added support for ERC20 Paymasters.

v4.20

08 Aug 20:18
dafafea
Compare
Choose a tag to compare

What's Changed

  • [Native] Upgrade MetaMask SDK to 2.1.0 by @ecp4224 in #207
    • Utilizes MetaMask's new ConnectWith functionality to connect and switch to the right network within a single call.
    • Improves network switching behavior and handled errors better.
    • Fixes errors encountered when switching to a MetaMask default chain such as Sepolia.
    • Refactored internal code to use new MetaMaskSDK APIs.
  • [Cross-Platform] Added support for new chains.

v5.0.0-beta.2

07 Aug 20:08
75c36cb
Compare
Choose a tag to compare
v5.0.0-beta.2 Pre-release
Pre-release

What's Changed

  • Added Farcaster and Telegram as additional InAppWallet AuthProvider options.

Single DLL update, it's that easy with v5, works everywhere.

v5.0.0-beta.1

07 Aug 06:54
7f01c8a
Compare
Choose a tag to compare
v5.0.0-beta.1 Pre-release
Pre-release

A New Era for Thirdweb's Unity SDK

We are thrilled to announce the beta release of our v5 SDK—our most significant update yet, set to redefine blockchain integration in gaming.

Building on our .NET SDK, we've minimized dependencies and reduced the package size by 90%. This beta is the first step toward truly unleashing the potential of blockchain technology in games, offering composable, simple, and clean APIs that can be utilized from anywhere.

Key Improvements

Unified API

  • Seamless Integration Across Platforms: Enjoy a consistent experience across WebGL, Desktop, and Mobile without the need for the WebGL Bridge. Develop once, deploy everywhere.

Enhanced Composability

  • Chain-Agnostic Interaction: Our APIs are designed to work seamlessly with multiple chains, removing the complexities of state management.

Native Experience

  • Stable and Predictable Upgrades: Utilizing our .NET core, the SDK offers a native experience, ensuring stability and predictability with each upgrade.

Simplified ThirdwebManager

  • Intuitive API Changes:
    • ThirdwebManager.Instance.SDK.GetContract is now ThirdwebManager.Instance.GetContract, returning ThirdwebContract.
    • ThirdwebManager.Instance.SDK.Wallet.Connect is now ThirdwebManager.Instance.ConnectWallet, returning IThirdwebWallet.
  • Enhanced Wallet Management: Effortlessly manage multiple wallet connections and track the active wallet.
  • Streamlined Setup: The prefab setup is now more intuitive, making it easier for developers to integrate and get started.

Optimized Package

  • Lighter and Faster: A cleaner, lighter Unity package with minimal dependencies, significantly enhancing performance.
  • Refined Architecture: We've taken control of all layers, excluding the AWS SDK and using Nethereum only for types/encoding. Libraries like Newtonsoft.Json and EDM4U are included to ensure efficiency.

Cross-Platform Consistency

  • Uniform Behavior Across Platforms: Enjoy consistent behavior across all platforms—what you see in the editor is what you get in WebGL, Standalone, and Mobile runtime environments.
  • Fully Customizable: The SDK can be white-labeled to match your branding needs.

Comprehensive Chain Support

  • Universal Compatibility: All chains are supported, and no patches are needed to support newly deployed chains.

Join the Future of Blockchain Gaming

Our v5 SDK is still in active development, and we invite you to be part of this journey. For more details, visit our v5 branch readme.

Documentation and Support

v4.19.0

06 Aug 23:12
61d0a57
Compare
Choose a tag to compare

What's Changed

  • [Native] Added support for Discord Login.
  • [Cross-Platform] Added support for new chains.

Discord has been added to Prefab_ConnectWallet and can be tested in Scene_Prefabs

discord-unity-v4

v4.18.0

01 Aug 00:34
0b3f1b9
Compare
Choose a tag to compare

What's Changed

  • [WebGL] Added support for Coinbase Smart Wallets
    • Simply use the existing WalletProvider.Coinbase in WebGL to test it out!
    • If you do not have a Coinbase wallet browser extension, you will be prompted to create a Coinbase Smart Wallet.
    • Note that to test this locally you must add a CORS header, see our WebGL Build Instructions for example code.
  • [WebGL] Updated bridge.
  • [Cross-Platform] Added support for new chains.

99e6ec58743f279a84d0a920b25d39d7