Releases: thirdweb-dev/unity
v5.5.0
What's Changed
- Adds MarketplaceV3 extensions.
- Supports
IDirectListings
,IEnglishAuctions
andIOffers
- Easier to use than direct
ThirdwebContract.Write
calls as the extensions are type safe and able to automatically handle approvals and more (opt-in). - Full reference here - accessible using
contract.Marketplace
extensions.
- Supports
- New Utilities
- Adds standalone
Utils.FetchGasPrice
(legacy tx) andUtils.FetchGasFees
(eip-1559) functions to retrieve chain gas info if needed. - Adds
Utils.HexToBigInt
converting hex strings toBigInteger
directly.
- Adds standalone
v5.4.0
What's Changed
Account Abstraction Improvements
We've sped up SmartWallet
transactions and optimized various internal flows, resulting in up to 50% speed increases from transaction creation to estimation to a receipt being returned. This applies for all flows
Furthermore, we've added an internal feature to automatically detect if a chain is built on the zkSync stack and unlock zkSync specific functionality such as zkSync specific transaction input or Native Account Abstraction automatically.
New Features
Added Utils.GetSocialProfiles
- fetch ENS, Farcaster and Lens profiles given a wallet address or ENS as well as their metadata and more.
A single line of code to fetch metadata about a wallet address and display it in game as you please!
SocialProfiles socialProfiles = await Utils.GetSocialProfiles(client, addressOrEns: "joenrv.eth");
Example returned object
{
"EnsProfiles": [
{
"name": "joenrv.eth",
"address": "0x2247d5d238d0f9d37184d8332aE0289d1aD9991b",
"avatar": "ipfs://bafybeic2wvtpv5hpdyeuy6o77yd5fp2ndfygppd6drdxvtfd2jouijn72m"
}
],
"FarcasterProfiles": [
{
"fid": 2735,
"bio": "Eng Lead @ thirdweb",
"pfp": "https://lh3.googleusercontent.com/EUELPFJzdDNcc3qSaEMekh0_W16acnS8MSvWizt-7HPaQhfJsNFC5HA0W4NKcy6CN9zmV7d4Crqg2B8qM9BpiveqVTl2GPBQ16Ax2IQ",
"username": "joaquim",
"addresses": [
"0x2247d5d238d0f9d37184d8332ae0289d1ad9991b",
"0xf7970369310b541b8a84086c8c1c81d3beb85e0e"
]
}
],
"LensProfiles": [
{
"name": "joaquim",
"bio": "Lead engineer @thirdweb",
"picture": "https://ik.imagekit.io/lens/media-snapshot/557708cc7581172234133c10d473058ace362c5f547fa86cee5be2abe1478e5b.png"
}
],
"OtherProfiles": []
}
Unified Identity - Account Linking DX Improvements
- Exposes Account Linking functionality (LinkAccount & GetLinkedAccounts) at the
IThirdwebWallet
level. - You may now link accounts directly to a
SmartWallet
signer i.e. personal wallet without needing to fetch the signer withSmartWallet.GetPersonalWallet
or deal with casting to the right types. - External wallets or external wallets being used as SmartWallet signers do not support this feature.
v5.3.1
What's Changed
- Adds ZkSync Native Account Abstraction support for Creator Testnet.
v5.3.0
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);
- You now have the option to bypass WalletConnect Unity default synchronization context check as needed by setting
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
What's Changed
- Significantly reduce CPU load when making long running requests.
v5.2.1
What's Changed
- New AuthProvider:
Coinbase
forInAppWallet
andEcosystemWallet
. - Fixed issue where
EcosystemWallet
account linking could fail when linking OAuth.
v5.2.0
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 aTexture2D
and potentially display it in a UI Image.
v5.1.1
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
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)
- Apple
- 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 usingThirdwebManager
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
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.