// 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)}");