Skip to content

v5.0.0-beta.3

Pre-release
Pre-release
Compare
Choose a tag to compare
@0xFirekeeper 0xFirekeeper released this 13 Aug 00:00
8ddedb6

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.