.NET/Unity - Steam Login & TokenPaymasters: pay for gas with Lisk LSK, Base USDC or Celo CUSD!

Firekeeper

What's Changed

  • Added AuthProvider.Steam as a login option for In-App or Ecosystem Wallets.
// Using .NET SDK
var steamWallet = await InAppWallet.Create(client: client, authProvider: AuthProvider.Steam);
if (!await steamWallet.IsConnected())
{
_ = await steamWallet.LoginWithOauth(...);
}
var steamWalletAddy = await steamWallet.GetAddress();
// Using Unity SDK
var steamWalletOptions = new WalletOptions(
provider: WalletProvider.InAppWallet,
chainId: 1,
inAppWalletOptions: new InAppWalletOptions(authprovider: AuthProvider.Steam);
);
var steamWallet = await ThirdwebManager.Instance.ConnectWallet(options);
var steamWalletAddy = await steamWallet.GetAddress();
  • Added the ability to pay for gas with ERC20 tokens when using Smart Wallet.
    • Currently supports Base USDC, Celo CUSD, and Lisk LSK tokens.
    • Simply select a TokenPaymaster when creating a SmartWallet and all transactions will be paid for with the corresponding ERC20 from the user's Smart Wallet.
    • Useful on L2s where the native token is ETH and you want to enshrine another coin or onramp your users directly to that coin.
    • These TokenPaymasters entirely operate onchain, leveraging popular DEXes and decentralized price feeds from Uniswap & Chainlink.
    • This product is in beta, and only compatible with EntryPoint v0.7.0, which we auto select for you if not overriden when configurin your wallet.
// Example of paying for a transaction ERC20 stablecoins instead of native ETH
// Using .NET SDK (Lisk LSK)
var chainId = 1135; // lisk
var erc20SmartWallet = await SmartWallet.Create(
personalWallet: privateKeyWallet,
chainId: chainId,
tokenPaymaster: TokenPaymaster.LISK_LSK
);
// Using Unity SDK (Base USDC)
var chainId = 8453; // base
var erc20SmartWallet = await ConnectWallet(
new WalletOptions(
WalletProvider.InAppWallet,
chainId,
inAppWalletOptions: new InAppWalletOptions(authprovider: AuthProvider.Steam),
smartWalletOptions: new SmartWalletOptions(sponsorGas: true, tokenPaymaster: TokenPaymaster.BASE_USDC)
)
);
// Then just trigger any transaction!
var erc20SmartWalletAddress = await erc20SmartWallet.GetAddress();
Debug.Log($"ERC20 Smart Wallet address: {erc20SmartWalletAddress}");
var receipt = await erc20SmartWallet.Transfer(chainId: chainId, toAddress: erc20SmartWalletAddress, weiAmount: 0);
Debug.Log($"Receipt: {JsonConvert.SerializeObject(receipt, Formatting.Indented)}");

Links

.NET Release | NuGet Release | Unity Release

Docs | Support