Releases: thirdweb-dev/unity
v4.20.1
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
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 throughThirdwebTransaction
. - 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 useUtils.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
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
andThirdwebContract.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
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
What's Changed
- Added
Farcaster
andTelegram
as additional InAppWalletAuthProvider
options.
Single DLL update, it's that easy with v5, works everywhere.
v5.0.0-beta.1
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 nowThirdwebManager.Instance.GetContract
, returningThirdwebContract
.ThirdwebManager.Instance.SDK.Wallet.Connect
is nowThirdwebManager.Instance.ConnectWallet
, returningIThirdwebWallet
.
- 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
- Unity SDK v5 Documentation: Read the Docs
- .NET SDK Documentation: Read the Docs
- Support and Feedback: Contact Support
v4.19.0
v4.18.0
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.
- Simply use the existing
- [WebGL] Updated bridge.
- [Cross-Platform] Added support for new chains.
v4.17.0
What's Changed
- [Cross-Platform] General improvements and cleanup of the low-level
Transaction
builder class, typically created from Contract.Prepare.- Added Transaction.Populate - a way for you to prepare a transaction by populating all its fields without sending it.
- Added Transaction.GetGasFees to get EIP-1559 max fee per gas and max priority fee per gas.
Contract.Prepare
will now return fully populated Transaction includingData
cross platform, instantly.- Fixed edge case where if a chain did not support EIP-1559, and no max fee/max priority fee were explicitly set but a gas price was explicitly set, the gas price would be recalculated and overriden.
- [Cross-Platform] Added Wallet.GetNonce - a simple way to get the connected wallet's nonce, defaults to
pending
blockTag but can be overriden. - [Cross-Platform] Removed the
Contract.Prepare
variant that takes in afrom
address override to avoid confusion and simplify syntax. - [Cross-Platform] Added support for new chains.
- [WebGL] Updated bridge.
v4.16.8
What's Changed
- [Cross-Platform] Added Oasys Mainnet to list of chains with forced type 0 transactions.