Releases: thirdweb-dev/unity
v4.12.4
What's Changed
- [Cross-Platform] Added support for Treasure Ruby testnet.
v4.12.3
What's Changed
- [Native] Non-Blocking Encryption/Decryption: The process of encrypting/decrypting data when connecting to a
LocalWallet
has been optimized to avoid blocking the main thread.- Resolved Issue: This change fixes an issue where users experienced a freeze of approximately 0.5 to 1.5 seconds upon connecting to a
LocalWallet
. - Performance Trade-off: As a side effect of this update, the connection time to a
LocalWallet
may be about 1 second slower, depending on the device's performance capabilities.
- Resolved Issue: This change fixes an issue where users experienced a freeze of approximately 0.5 to 1.5 seconds upon connecting to a
v4.12.2
What's Changed
- [Cross-Platform] Updated chains package, added new chains.
- [WebGL] Updated bridge.
v4.12.1
What's Changed
- [Cross-Platform] Added
Wallet.AuthenticateAndLoginServerSide
that helps you use thirdweb Auth more easily, cross-platform.- Previously,
Wallet.Authenticate
mostly acted as a signed payload generator rather than a full authentication flow, and stored a local SIWE style session. You had to do the extra work of serializing, encoding and logging in to your backend as an extra step. - You may use this helper method instead if you have thirdweb Auth setup on your backend, passing in your domain and chain id, to replicate a full login flow without having to deal with payloads, encoding or signing/verifying.
- Defaults to calling
/auth/payload
and/auth/login
, overrideable. - Works with Smart Wallets.
- Uses
UnityWebRequest
, meaning it's WebGL compatible, however make sure CORS is setup correctly to test in WebGL as usual.
- Previously,
v4.12.0
What's Changed
Providing new ways for devs to sponsor transactions, powered by Engine!
- [Cross-Platform] Added support for the thirdweb Engine Relayer
- This relayer is a service provided by thirdweb for an alternative way to sponsor transactions on behalf of users through Engine.
- When using
Transaction.Send
orTransaction.SendAndWaitForTransactionResult
you may specify whether to use this gasless feature or not, other higher level APIs will default to the gasless flow if you have the relayer set up. - Replaces OpenZeppelin Defender Options.
- We still recommend using Account Abstraction for gasless sponsorship features through Smart Wallets, however in some cases a relayer is needed!
- [Native] Improved
Contract.Write
flow.- Better gas limit/price/fees estimations when not provided, similar to other APIs.
- Now uses the gasless relayer by default if it is set up in your
ThirdwebManager
, similar to other higher level APIs.
Visit our documentation portal to learn more at https://portal.thirdweb.com/unity
v4.11.0
What's Changed
- [Cross-Platform] Using Custom Contracts no longer requires passing an ABI on any platform.
- Using
Contract.Prepare
,Contract.Read
orContract.Write
will populate the ABI at runtime if it was not provided. - This is a great way to get started quickly, but it is not recommended for production environments for speed reasons.
- We've also added
Contract.FetchAbi
to fetch the ABI manually.
- Using
- [WebGL] Fixed regression introduced in 4.10 where using Smart Wallets with Embedded Wallets as a signer in WebGL would have caused
invalid auth provider: undefined
to be thrown. We now handle that case correctly. - [Cross-Platform] Renamed
EmbeddedWallet
toInAppWallet
, as well as most other related scripts, prefabs and files.- There are no functionality changes between the old
EmbeddedWallet
and the newInAppWallet
. - You may need to slightly adapt any previous prefabs you had and make sure the renamed classes are referenced properly.
- This is in an effort to move to a powerful In-App Wallet that potentially will encompass other wallet type functionalities within itself.
- There are no functionality changes between the old
This is a minor update, meaning some structural or api breaking changes occured. When upgrading, it is best to remove previous SDK files for a smooth importing process, backing up any prefab copies or scripts extending or overriding thirdweb prefabs and scripts.
v4.10.1
What's Changed
- [WebGL] Upgraded bridge, includes optimizations and improved smart wallet transaction simulation (less silent reverts).
- [Native] Added low level
Contract.ReadRaw
for parsing complex tuples into a Nethereum code generated style output type, useful when basic dynamic invocation/deserialization is not good enough for your use case. - [Native]
Wallet.GetAllActiveSigners()
now also returns admins, you may iterate through the output and checkisAdmin
to differentiate admins from basic session keys.
v4.10.0
What's Changed
Sign-in with your Phone Number! (Native Platforms)
Similar to the Email OTP flow, the Phone OTP auth method will send you an OTP as an SMS, resulting in an Embedded Wallet.
// Reference to your Thirdweb SDK
var sdk = ThirdwebManager.Instance.SDK;
// Configure the connection
var connection = new WalletConnection(
provider: WalletProvider.EmbeddedWallet,
chainId: 1,
phoneNumber: "+123456789",
authOptions: new AuthOptions(
authProvider: AuthProvider.PhoneOTP,
)
);
// Connect the wallet
string address = await sdk.Wallet.Connect(connection);
You may test it out in Scene_Prefabs
, the input field has been updated to check for both emails and phone numbers and adapt.
When creating your own UI, we suggest adapting the input field type according to the auth method used, specially for mobile.
This feature is only available on native platforms, WebGL coming soon!
Transaction Flow
This update brings the unification of all transaction flows and centralizes them around the Transaction
class. This means that edge cases, issues with gas on some chains with some APIs, and raw transaction APIs now all should feel smoother and more consistent.
What to expect:
- We will always estimate gas on your behalf if a gas limit is not passed.
- When on a chain that supports EIP-1559, we will always use optimized max and priority fee fetching mechanics and submit the tx as 1559, if a gas price is not explicitly passed (thus overriding our default checks for 1559 support).
- When on a chain that does not support EIP-1559, we will always use optimized gasPrice fetching mechanics and submit the tx as a legacy tx, if a max/priority fee is not explicitly passed (the transaction may still not be legacy with some external wallet providers that may override this).
- Account Abstraction has its own gas pricing flow and will always price User Operations accordingly.
- If relayer options are provided, the transactions will always default to the relayer unless a low level API is used where that can be overridden, such as
Transaction.Send
. Note that we recommend using Account Abstraction instead of relayers in general.
Miscellaneous
- [Cross-Platform] Added a utility to copy text to a buffer for cross-platform usage,
Utils.CopyToClipboard
(used inPrefab_ConnectWallet
) - [Native] Added a utility to fetch legacy gas price
Utils.GetLegacyGasPriceAsync
. - [WebGL] Fixed an Account Abstraction edge case where simulation would not account for delegate call overheads in the gas limit.
v4.9.1
What's Changed
- [Cross-Platform] Improved cross-chain gas price accuracy when using thirdweb default bundler with Account Abstraction.
- [Native]
Transaction.WaitForTransactionResult
now supports AA transactions and properly decodes silent reverts, throwing accordingly. - [Native] Updated chains.
- [WebGL] Updated bridge.
This patch is greatly recommended for Account Abstraction users.
v4.9.0
What's Changed
Thirdweb Pay has made its way to Unity!
New Cross-Platform Feature: Buy with Crypto
Simply add using Thirdweb.Pay;
at the top of your file to get access to static methods:
ThirdwebPay.GetBuyWithCryptoQuote
: Get a quote for swapping any token pair.ThirdwebPay.BuyWithCrypto
: Pass said quote into this function to execute the swap and get a transaction hash.ThirdwebPay.GetBuyWithCryptoStatus
: Get the status of your swap using the transaction hash.ThirdwebPay.GetBuyWithCryptoHistory
: Additional API to get the swap history of a wallet address.
Buy with Crypto Unity API Reference can be found here.
In addition, a new scene has been added: Scene_Prefabs
with a prefab Prefab_BuyWithCrypto
to illustrate the basic flow. It is set up for Polygon and will buy 2 WMATIC using the connected wallet's MATIC funds. You may edit the behavior as you please, this prefab serves as an example use case, code can be found in Prefab_BuyWithCrypto.cs
Other additions
- [Cross-Platform]
Wallet.SendRawTransaction
no longer waits for the transaction to be mined and returns a tx hash. - [Cross-Platform]
Wallet.ExecuteRawTransaction
is a new function that was added this update and will wait for the transaction to be mined. - [Cross-Platform] Fixed issues with native token transfers using
Wallet.Transfer
on some chains or some wallets. - [Cross-Platform] Legacy type transactions are no longer used in mid/high level APIs. They are only used in low level APIs when a gas price is explicitly passed.
- [Native] Fallback gas estimation when Polygon gas station requests fail are now more reliable.
- [Cross-Platform] Improved support for Smart Wallets for all of the above.
Documentation Portal: https://portal.thirdweb.com/unity