|
22 | 22 | var client = ThirdwebClient.Create(secretKey: secretKey, fetchTimeoutOptions: new TimeoutOptions(storage: 120000, rpc: 120000, other: 120000)); |
23 | 23 |
|
24 | 24 | // Create a private key wallet |
25 | | -var privateKeyWallet = await PrivateKeyWallet.Generate(client: client); |
| 25 | +var privateKeyWallet = await PrivateKeyWallet.Generate(client); |
26 | 26 |
|
27 | 27 | // var walletAddress = await privateKeyWallet.GetAddress(); |
28 | 28 | // Console.WriteLine($"PK Wallet address: {walletAddress}"); |
|
324 | 324 |
|
325 | 325 | #endregion |
326 | 326 |
|
| 327 | +#region ERC20 Smart Wallet - Celo Dollar |
| 328 | + |
| 329 | +// var erc20SmartWallet = await SmartWallet.Create( |
| 330 | +// personalWallet: privateKeyWallet, |
| 331 | +// chainId: 42220, // celo mainnet |
| 332 | +// gasless: true, |
| 333 | +// factoryAddress: Constants.DEFAULT_FACTORY_ADDRESS_V07, |
| 334 | +// entryPoint: Constants.ENTRYPOINT_ADDRESS_V07, |
| 335 | +// tokenPaymaster: TokenPaymaster.CELO_CUSD |
| 336 | +// ); |
| 337 | +// var erc20SmartWalletAddress = await erc20SmartWallet.GetAddress(); |
| 338 | +// Console.WriteLine($"ERC20 Smart Wallet address: {erc20SmartWalletAddress}"); |
| 339 | + |
| 340 | +// var selfTransfer = await ThirdwebTransaction.Create(wallet: erc20SmartWallet, txInput: new ThirdwebTransactionInput(chainId: 42220, to: erc20SmartWalletAddress, value: 0, data: "0x")); |
| 341 | + |
| 342 | +// var estimateGas = await ThirdwebTransaction.EstimateGasCosts(selfTransfer); |
| 343 | +// Console.WriteLine($"Self transfer gas estimate: {estimateGas.Ether}"); |
| 344 | +// Console.WriteLine("Make sure you have enough cUSD!"); |
| 345 | +// Console.ReadLine(); |
| 346 | + |
| 347 | +// var receipt = await ThirdwebTransaction.SendAndWaitForTransactionReceipt(selfTransfer); |
| 348 | +// Console.WriteLine($"Self transfer receipt: {JsonConvert.SerializeObject(receipt, Formatting.Indented)}"); |
| 349 | + |
| 350 | +#endregion |
| 351 | + |
327 | 352 | #region Chain Data Fetching |
328 | 353 |
|
329 | 354 | // var chainData = await Utils.GetChainMetadata(client, 421614); |
|
368 | 393 |
|
369 | 394 | #endregion |
370 | 395 |
|
| 396 | +#region InAppWallet - Email |
| 397 | + |
| 398 | +// var inAppWalletEmail = await InAppWallet.Create(client: client, email: "[email protected]"); |
| 399 | +// if (!await inAppWalletEmail.IsConnected()) |
| 400 | +// { |
| 401 | +// _ = await inAppWalletEmail.SendOTP(); |
| 402 | +// Console.WriteLine("Enter OTP:"); |
| 403 | +// var otp = Console.ReadLine(); |
| 404 | +// _ = await inAppWalletEmail.LoginWithOtp(otp); |
| 405 | +// } |
| 406 | +// var inAppWalletOAuthAddress = await inAppWalletEmail.GetAddress(); |
| 407 | +// Console.WriteLine($"InAppWallet address: {inAppWalletOAuthAddress}"); |
| 408 | + |
| 409 | +#endregion |
| 410 | + |
371 | 411 | #region Smart Wallet - Gasless Transaction |
372 | 412 |
|
373 | 413 | // var smartWallet = await SmartWallet.Create(privateKeyWallet, 78600); |
|
0 commit comments