Skip to content

Releases: thirdweb-dev/unity-sdk

v5.3.0

27 Sep 20:44
250c791
Compare
Choose a tag to compare

What's Changed

  • ThirdwebManager inspector is a little more interactive now.
thirdwebmanager-tabs.mp4
  • Improved default redirect page visuals when logging in with OAuth from desktop platforms.

    • Added option to override said html with your own.
  • Option to bypass WalletConnect context checks by @BoysheO in #216

    • You now have the option to bypass WalletConnect Unity default synchronization context check as needed by setting AppContext.SetSwitch("IsSkipWalletConnectSyncCtxCheck", true);
  • ThirdwebClient.Create no longer takes in raw headers, now only takes in general sdk information optionally. This should not affect most users.
    • Improved http client cloning when needed in external modules.
    • Added CrossPlatformUnityHttpClient class which encompasses default .NET and WebGL ones.

New Contributors

v5.2.2

23 Sep 21:08
dcc5c18
Compare
Choose a tag to compare

What's Changed

  • Significantly reduce CPU load when making long running requests.

v5.2.1

21 Sep 01:21
fc656b0
Compare
Choose a tag to compare

What's Changed

  • New AuthProvider: Coinbase for InAppWallet and EcosystemWallet.
  • Fixed issue where EcosystemWallet account linking could fail when linking OAuth.

v5.2.0

20 Sep 19:13
154cb1b
Compare
Choose a tag to compare

What's Changed

  • Ecosystem Wallets implementation in .NET is now compatible with our previous JS implementation of Ecosystem Wallets.
    • If you had created accounts or had a user base from web sharded Ecosystem Wallets, they will automatically be migrated to the new performant enclave system upon first login.
    • No breaking API changes here, this change detects if an authenticated user requires migration and performs it.
  • ERC721 and ERC1155 NFT Contract Extensions such as _GetAll and _GetOwned now have default pagination (100 first token ids).
    • This is to avoid fetching an entire collection at once by mistake.
    • If the contract is ERC721A, tokensOfOwnerIn will be used before falling back to other extensions.
    • If the contract is ERC721Enumerable, tokensOfOwnerByIndex will be used before falling back to single fetching.
    • Improved batching of such calls.
  • Implemented ConcurrentQueue for RPC and improved batching/caching logic
    • If you do end up making large calls, such as fetching an entire collection, it should be handled gracefully
    • Avoid a lot more 429s
  • Speed up Smart Wallet user operations
    • No longer estimates the entire user operation gas and simulates prior to sending it.
    • This does not affect errors being caught.
    • This means if you are estimating gas using ThirdwebTransaction, you will only be returned the internal call gas limit rather than the entire op.
    • Less API calls at runtime, 30% faster execution.
    • If you still want to estimate the actual user operation gas costs, you can use SmartWallet.EstimateUserOperationGas
  • Fixed issue with _MintWithSignature extensions where the expected signature bytes would be passed as hex.
  • Added ToQRTexture helper extension for converting any text to a Texture2D and potentially display it in a UI Image.

v5.1.1

13 Sep 21:50
3540196
Compare
Choose a tag to compare

What's Changed

  • Adds AuthProvider.X as a login option. Linking supported.
// InAppWallet
var iawOptions = new WalletOptions(
    provider: WalletProvider.InAppWallet,
    chainId: 421614,
    inAppWalletOptions: new InAppWalletOptions(authprovider: AuthProvider.X)
);
var iaw = await ThirdwebManager.Instance.ConnectWallet(iawOptions) as InAppWallet;

// EcosystemWallet
var ecoOptions = new WalletOptions(
    provider: WalletProvider.EcosystemWallet,
    chainId: 421614,
    ecosystemWalletOptions: new EcosystemWalletOptions(
        ecosystemId: "ecosystem.the-bonfire",
        authprovider: AuthProvider.X
    )
);
var eco = await ThirdwebManager.Instance.ConnectWallet(ecoOptions) as EcosystemWallet;
  • Fixes edge case when sending two SmartWallet transactions at once from an undeployed account and using EntryPoint 0.7.0 where deployment code would be duplicated causing an error.

v5.1.0

11 Sep 19:01
52a6e59
Compare
Choose a tag to compare

The Pinnacle of Account Systems Has Been Reached

This is no exaggeration, our Ecosystem Wallets are now so feature rich there is no use case in all of gaming that it does not support.

Thirdweb now provides you with a cross-platform, cross-sdk, cross-device, cross-language blockchain-powered, secure, non-custodial account system that you can not only reuse across your own games and apps, but also your ecosystem partnners' games and appsl.

It doesn't stop there, you can use this EcosystemWallet to create a Guest mode (AuthProvider.Guest) first and upgrade later through Account Linking, which we feature here alongside other additions like Line authentication. All of this without losing the EcosystemWallet address.

The Account Linking feature, once understood, unlocks infinite possibilities as it ties into all our auth methods, which now include:

  • Email (OTP)
  • Phone (OTP)
  • Google
  • Apple
  • Facebook
  • Discord
  • Farcaster
  • Telegram
  • Line
  • Siwe (Sign in with Ethereum - yep you can link external wallets and even login to your EcosystemWallet with them next time)
  • Guest (does not require any inputs, simply choose it as your auth provider to create a guest mode)

It doesn't stop there, we also offer custom authentication:

  • JWT (you want to create a wallet out of an OIDC-compatible authentication system, entirely possible)
  • AuthEndpoint (you want to go even further, having us verify a generic payload against your backend, for things like TG Mini-Apps)

There is not a single use case we don't support. You just have to integrate, and we're here to help.

If you don't want to commit to a performant, scalable, entirely secure and shareable with third-parties and fast EcosystemWallet, don't worry, all of the above is available for InAppWallet too.

Now for how-to's

Do note that once again, it's the same API for InAppWallet, but without ecosystemId and the optional ecosystemPartnerId.

Below are the different ways you can use some of the functionality introduced in this version.

You can turn any of these wallets into a Smart Wallet easily, using SmartWallet.Create or by passing SmartWalletOptions to Unity's ThirdwebManager.ConnectWallet function on top of your base options / using the ThirdwebManager.UpgradeToSmartWallet helper if you want to do it later.

Login With Guest (.NET SDK)

var guestWallet = await EcosystemWallet.Create(ecosystemId: "ecosystem.the-bonfire", client: client, authProvider: AuthProvider.Guest);
if (!await guestWallet.IsConnected())
{
    _ = await guestWallet.LoginWithGuest();
}
var address = await guestWallet.GetAddress();

Login With Guest (Unity)

var walletOptions = new WalletOptions(
    provider: WalletProvider.EcosystemWallet,
    chainId: 421614,
    ecosystemWalletOptions: new EcosystemWalletOptions(ecosystemId: "ecosystem.the-bonfire", authprovider: AuthProvider.Guest)
);
var ecosystemWallet = await ConnectWallet(walletOptions) as EcosystemWallet;

Get Linked Accounts

var linkedAccounts = await ecosystemOrInAppWallet.GetLinkedAccounts();

Link a new Account

All Auth Methods Supported! Just pass the related params to that auth method that you typically would

// Assuming you already have a connected wallet you want to link a new profile to
var walletToLink = await InAppWallet.Create(client: client, authProvider: AuthProvider.Google);
var linkedAccounts = await mainConnectedWallet.LinkAccount(walletToLink );

A Full Unity Example, ThirdwebManager is there as a helper after all and APIs are simpler

// Sign up with guest mode to avoid the friction of auth with new users
var walletOptions = new WalletOptions(
    provider: WalletProvider.EcosystemWallet,
    chainId: 421614,
    ecosystemWalletOptions: new EcosystemWalletOptions(ecosystemId: "ecosystem.the-bonfire", authprovider: AuthProvider.Guest)
);
var ecosystemWallet = await ConnectWallet(walletOptions) as EcosystemWallet; // or EcosystemWallet.Create

// This address will not change after linking i.e. in this case "upgrading" your account
var address = await ecosystemWallet.GetAddress();
Debug.Log($"Connected EcosystemWallet: {address}");

// This is how you display currently linked accounts
var linkedAccounts = await ecosystemWallet.GetLinkedAccounts();
Debug.Log($"Linked accounts: {Newtonsoft.Json.JsonConvert.SerializeObject(linkedAccounts)}");

// Create a raw EcosystemWallet to link, in this example user would have chosen to link Line
var ecosystemWalletToLink = await EcosystemWallet.Create(
    client: ThirdwebManager.Instance.Client,
    ecosystemId: "ecosystem.the-bonfire",
    authProvider: AuthProvider.Line
);

// Use the Unity SDK helper to link the accounts
var newLinkedAccounts = await ThirdwebManager.Instance.LinkAccount(ecosystemWallet, ecosystemWalletToLink);
Debug.Log($"New linked accounts: {Newtonsoft.Json.JsonConvert.SerializeObject(newLinkedAccounts)}");

Additional changes

  • Improved speed of NFT-related extensions.
  • Fixed an issue with SIWE as an AuthProvider when using ThirdwebManager to connect.
  • Added contract extensions ERC721A_TokensOfOwner & ERC721A_TokensOfOwnerIn.
  • Added optional pagination to all _GetAllNFTs & _GetOwnedNFTs extensions.
  • Improved ERC721A NFT-fetching speed.

Links

Unity v5 Portal Docs | .NET Portal Docs | .NET Full Reference

Note from Firekeeper

Our goal at thirdweb has always been to work for game developers - with such systems, you're able to offload all the account system, auth, database, item management, currency management, and analytics work to the blockchain. This is what we do, and we want to help you and listen to feed back - make sure you reach out, we have many programs to get you going!

We have the recipe to make blockchain games unbeatable, cheap, fast, invisible. Persistent In-App & Ecosystem Wallets paired with Account Abstraction, Session Keys and some easy to deploy contracts is what we do. It's all open-source, it's all yours to manage.

It's time to ditch external wallets.

Blockchain games can finally focus on being fun and on distribution across different runtime platforms and companion apps.

v5.0.2

10 Sep 04:57
00a6084
Compare
Choose a tag to compare

What's Changed

  • Removed redundant signature request when estimating gas or simulating user operations.
  • Improved Metamask extension network switching behavior when already on the correct network.

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.